[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: intl.m4: check for NL_LOCALE_NAME fails with CFLAGS=-Wall -Werror
From: |
Bruno Haible |
Subject: |
Re: intl.m4: check for NL_LOCALE_NAME fails with CFLAGS=-Wall -Werror |
Date: |
Sun, 26 Aug 2007 12:15:50 +0200 |
User-agent: |
KMail/1.5.4 |
Hello,
Marti Raudsepp wrote:
> In the intl.m4 autoconf macro, the check for NL_LOCALE_NAME macro
> fails when CFLAGS include both -Wall and -Werror, because GCC is
> warning about an unused variable.
Generally, -Werror is not supported by autoconf macros originating from
GNU gettext or GNU gnulib: there are simply too many things a compiler
could warn about, on various platforms.
Nevertheless, if all that hurts you is this one warning, I am willing
to make it go away.
> I'm using gettext version 0.16.1.
>
> Here's the relevant snippet from config.log:
> configure:24553: gcc -o conftest -O0 -g3 -Werror -Wall
> -I/usr/include/neon conftest.c -lreadline -lcurses >&5
> cc1: warnings being treated as errors
> conftest.c: In function 'main':
> conftest.c:131: warning: unused variable 'cs'
> configure:24559: $? = 1
> configure: failed program was:
> | /* confdefs.h. */
> [...]
> | #define _GNU_SOURCE 1
> [...]
> | /* end confdefs.h. */
> | #include <langinfo.h>
> | #include <locale.h>
> | int
> | main ()
> | {
> | char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
> | ;
> | return 0;
> | }
> configure:24577: result: no
Thanks for this info. I'm applying this:
2007-08-26 Bruno Haible <address@hidden>
* intl.m4 (gl_INTL_SUBDIR_CORE): Avoid an "unused variable" warning
in the _NL_LOCALE_NAME test.
Mentioned by Marti Raudsepp <address@hidden>.
--- intl.m4 28 May 2007 12:11:15 -0000 1.6
+++ intl.m4 26 Aug 2007 10:15:34 -0000
@@ -1,4 +1,4 @@
-# intl.m4 serial 5 (gettext-0.16.2)
+# intl.m4 serial 6 (gettext-0.16.2)
dnl Copyright (C) 1995-2007 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -209,7 +209,9 @@
AC_CACHE_CHECK([for NL_LOCALE_NAME macro], gt_cv_nl_locale_name,
[AC_TRY_LINK([#include <langinfo.h>
#include <locale.h>],
- [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));],
+ [char* cs = nl_langinfo(_NL_LOCALE_NAME(LC_MESSAGES));
+ return !cs;
+ ],
gt_cv_nl_locale_name=yes,
gt_cv_nl_locale_name=no)
])