autoconf-patches
[Top][All Lists]
Advanced

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

Re: Autoconf generates C code that doesn't compile with -Wstrict-prototy


From: Eric Blake
Subject: Re: Autoconf generates C code that doesn't compile with -Wstrict-prototypes and -Werror
Date: Tue, 16 Sep 2008 06:14:21 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Bradley Smith on 9/15/2008 5:08 AM:
> When using macros like AC_CHECK_LIB for example, the C code generated by
> autoconf does not compile when -Wstrict-prototypes and -Werror are set in
> the CFLAGS, and hence the test fails. (error: function declaration isn’t a
> prototype) etc.

Known problem.  In general, catering to -Werror is NOT autoconf's goal,
because there are just too many flavors of compilers out there, that have
too many variants on warnings to avoid.  The mailing list archives have
more on this topic.

> 
> Here is a patch that fixes this problem.

Thanks for the effort, but it cannot be applied as-is:

> -main ()
> +main (void)

There has been talk about switching to C89 as the default, and making
configure.ac writers explicitly request K&R support.  But right now, the
default is K&R support, with C89 as an explicit request, and the use of
void violates K&R.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjPox0ACgkQ84KuGfSFAYDtpgCgnCNA9XO8Iw0t9PSc6gFtGDds
+n4An0dtzqPJDbw/g2YqelgXdcqUey5h
=wp0p
-----END PGP SIGNATURE-----




reply via email to

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