[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_LANG_PROGRAM(C): function 'main' without prototype
From: |
Stepan Kasal |
Subject: |
Re: AC_LANG_PROGRAM(C): function 'main' without prototype |
Date: |
Wed, 25 Jun 2008 18:26:56 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
Hello,
On Tue, Jun 24, 2008 at 08:14:44PM +0200, Nico R. wrote:
> AC_LANG_PROGRAM(C) in c.m4 from autoconf:
> Shouldn’t the line
> main ()
> be
> main (void)
> instead?
I admit I'm not sure about this. The change would immediately break
K&R compilers but they are no longer in the target set anyway.
Let's wait for comments from those who know better. ;-)
> If CFLAGS contains '-Werror’
Well, the configure collects literally bits of information about the
platform. The bit is 0 or 1, depending on whether the compilation
(link) failed or not. Using -Werror may skew some results.
If these mis-detected bit of information break the build, we get a bug
report, like in this case. But what if the mis-detected bits do not
prevent a build? The build just fails to use a feature which should
otherwise be used, so the build disables that feature or reimplements
it internally.
Generally, while -Werror during "make" makes you more safe, -Werror
at configure time exposes you to extra risk.
Perhaps we should do something about it. Perhaps ./configure should
detect -Werror in CFLAGS (and other *FLAGS) and bail out with an
error message.
Wdyt?
Stepan Kasal