implicit declarations in acinclude.m4
Torbjorn Granlund
tg at gmplib.org
Mon Mar 31 18:11:17 UTC 2014
Marc Glisse <marc.glisse at inria.fr> writes:
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.
How unhappy are thos compilers?
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++).
I think the problem compiler might be available at g5.gmplib.org (and
you seem to have an account there).
g5$ gcc-3.3 -v
Reading specs from /usr/libexec/gcc/darwin/ppc/3.3/specs
Thread model: posix
gcc version 3.3 20030304 (Apple Computer, Inc. build 1819)
Torbjörn
Please encrypt, key id 0xC8601622
More information about the gmp-bugs
mailing list