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

Martin v. Loewis martin@loewis.home.cs.tu-berlin.de
Mon Jun 26 15:20:00 GMT 2000


> 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


More information about the Gcc-bugs mailing list