Re: AC_LANG_PROGRAM(C): function 'main' without prototype

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Eric Blake <ebb9@xxxxxxx> writes:

> According to Nico R. on 6/24/2008 12:14 PM:
>
> | Or may this cause problems with some compilers? Should
> | œôòø-Wstrict-prototypesœôòù be removed from CFLAGS instead? And should this be
> | fixed in autoconf or should I report a bug against glibc?
>
> I argue that using the construct main(){} not a bug in autoconf - we are
> using a valid C99 program (and I assume C89 as well, although I don't have
> C89 in front of me at the moment).  It may be worth asking the gcc folks,
> to see if they are issuing a bogus warning for a valid program, or whether
> they are intentionally giving a warning because the construct is of
> dubious value even though it is valid.

A conforming compiler is allowed to issue any diagnostic it likes, as
long as it emits all the required ones.  Such extra warnings are beyond
the scope of the standard.  The purpose of -Wstrict-prototypes is to
diagnose definitions that are not a prototype, which main(){} isn't.  By
the use of this option together with -Werror you are operating beyond
the requirements of the standard, and GCC is behaving as documented.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@xxxxxxx
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


_______________________________________________
Autoconf mailing list
Autoconf@xxxxxxx
http://lists.gnu.org/mailman/listinfo/autoconf


[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux