autoconf
[Top][All Lists]
Advanced

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

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


From: Andreas Schwab
Subject: Re: AC_LANG_PROGRAM(C): function 'main' without prototype
Date: Sun, 13 Jul 2008 09:20:48 +0200
User-agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.2 (gnu/linux)

Eric Blake <address@hidden> 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, address@hidden
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."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]