This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gcc compiles assert() to code that requires linking with gcc


> It would be reasonable for gcc (on Solaris only, of course) to have
> the exact same definition for assert, since libc's __assert is part of
> the platform (speaking binary-ly).  For complete portability (for a
> future glibc on Solaris, perhaps), also implement an __assert for
> Solaris only in libgcc to remove the dependency on libc.  It ought to
> be trivial to implement, perhaps using __eprintf.

For Solaris, as Zack explained, it is trivial not to install GCC's
assert.h, if /usr/include/assert.h really works (which I did not
verify too carefully). Patches in that direction are appreciated - of
course, such patches would remove your issue on Solaris only.

> But portable software doesn't use long long, as least not without a
> configure check.  Probably, general purpose libraries that try to
> maintain binary portability should avoid long long, even when
> configured with a compiler that provides it.

long long was taken just as an example. For another example,
multiplication of integer values always leads to a libgcc call on
SPARC v7 (as this chip has no hardware multiply). Are you saying
portable code should not multiply integers?

Regards,
Martin

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]