On Tue, Mar 14, 2006 at 03:12:29PM -0800, Ben Pfaff wrote: > Ron <[EMAIL PROTECTED]> writes: > > > With my current gcc (4.0.2-10), the following code: > > > > int main() { return 0; } > > > > Will warn: function declaration isn't a prototype > > if compiled with -Wstrict-prototypes. > > > > Since that is the signature for main which autoconf wraps its tests in > > when creating conftest.c -- then tests which should normally succeed, > > will fail if the language is C, and CPPFLAGS include -Wstrict-prototypes, > > and -Werror (the latter being my preferred habit for release builds). > > It's not reasonable to expect autoconf to work properly with > -Werror. When the next version of GCC comes out, it may add any > number of new warnings for code that is currently accepted > silently. Autoconf doesn't have any way to predict what these > new warnings will be. > > I too like to use -Werror for writing code. But I don't pass it > to Autoconf. And I recommend that you not do so as well.
Just for the record, I ran into this in the autoconf docs just now: - Macro: AC_LANG_WERROR Normally Autoconf ignores warnings generated by the compiler, linker, and preprocessor. If this macro is used, warnings will be treated as fatal errors instead for the current language. This macro is useful when the results of configuration will be used where warnings are unacceptable; for instance, if parts of a program are built with the GCC `-Werror' option. If the whole program will be built using `-Werror' it is often simpler to put `-Werror' in the compiler flags (`CFLAGS' etc.). cheers, Ron -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]