[PATCH util-macros 1/6] Fix the test for -Werror=attributes
Gaetan Nadon
memsize at videotron.ca
Wed Nov 2 07:35:39 PDT 2011
On Tue, 2011-11-01 at 13:16 -0700, Jeremy Huddleston wrote:
> The current test was always failing to compile because 'return 0;' was
> global rather than in the body of a function.
>
> Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
> ---
> xorg-macros.m4.in | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in
> index 0527dfe..3b02190 100644
> --- a/xorg-macros.m4.in
> +++ b/xorg-macros.m4.in
> @@ -1431,7 +1431,7 @@ if test "x$GCC" = xyes ; then
> AC_MSG_CHECKING([if $CC supports -Werror=attributes])
> save_CFLAGS="$CFLAGS"
> CFLAGS="$CFLAGS $STRICT_CFLAGS -Werror=attributes"
> - AC_COMPILE_IFELSE([AC_LANG_SOURCE([return 0;])],
> + AC_COMPILE_IFELSE([AC_LANG_SOURCE([], [return 0;])],
> [STRICT_CFLAGS="$STRICT_CFLAGS -Werror=attributes"
> AC_MSG_RESULT([yes])],
> [AC_MSG_RESULT([no])])
I used AC_LANG_PROGRAM and the generated test is:
int
main ()
{
return 0;
;
return 0;
}
Is this what you were expecting?
Using AC_LANG_PROGRAM([],[]) produces:
int
main ()
{
;
return 0;
}
Is that closer to what you want?
I did not experience the compile failure inititally.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111102/25720d9e/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.x.org/archives/xorg-devel/attachments/20111102/25720d9e/attachment.pgp>
More information about the xorg-devel
mailing list