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: Christopher Hulbert
Subject: Re: AC_LANG_PROGRAM(C): function 'main' without prototype
Date: Wed, 25 Jun 2008 13:12:53 -0400

On Wed, Jun 25, 2008 at 12:26 PM, Stepan Kasal <address@hidden> wrote:
> 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.

The problem with this solution is that it does not support compilers
that do not use the '-Werror' flag. The approach I use is to specify
compiler flags to use after configure (i.e. when actually building).
While this requires more thought from the user than just setting
CFLAGS=-Werror, I have found it useful in other cases as well. To get
some compiler flags past libtool, I have to use -Xcompiler before the
flag. This breaks the compiler at configure time, so the delayed flags
work there too.

Chris

>
> Wdyt?
>
> Stepan Kasal
>
>
> _______________________________________________
> Autoconf mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/autoconf
>




reply via email to

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