implicit declarations in acinclude.m4

Marc Glisse marc.glisse at inria.fr
Mon Mar 31 18:02:30 UTC 2014


Hello,

the tests in acinclude.m4 are often not correct C (they are not supposed 
to be, that's ok), but some stricter C99 compilers are unhappy about that. 
The main issue seems to be implicit declarations. There are many exit(0) 
where exit is not declared (and stdlib.h is not included) that could 
probably be replaced with return 0. The test for -lm uses log without 
including math.h.

Harder are the 2 long long reliability tests. They are for Apple's gcc 3.3 
with -mpowerpc64 and either -O1 or -O2, so it is tempting to just remove 
them (according to the comment, the compiler crashes, it isn't producing 
wrong code or anything hard to notice like that). It would be possible to 
move the definitions of g and h earlier in the test, but I have no way to 
check if that still triggers the bug. I could also update the test on 
__GNUC__ to check that it is <=3 and skip the weird code for more recent 
versions (as is already done for C++).

Any opinions?

-- 
Marc Glisse


More information about the gmp-bugs mailing list