implicit declarations in acinclude.m4

Vincent Lefevre vincent at vinc17.net
Mon Mar 31 20:03:51 UTC 2014


On 2014-03-31 20:26:04 +0200, Marc Glisse wrote:
> On Mon, 31 Mar 2014, Torbjorn Granlund wrote:
> 
> >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?
> 
> Enough to error out right there.

And this probably includes GCC with -Werror. For instance, I now test
MPFR with:

  CFLAGS="-O2 -Wall -Wold-style-declaration -Wold-style-definition
  -Wmissing-parameter-type -Wmissing-prototypes -Wmissing-declarations
  -Wmissing-field-initializers -Wno-error=unused-function -Werror"

to make sure that we follow the rules and detect potential problems
ASAP.

-- 
Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


More information about the gmp-bugs mailing list