Joel E. Denny | 9 Nov 19:20

lib/gettext.h breaks --enable-gcc-warnings

Several functions in Gnulib's gettext.h don't use their domain and 
category parameters.  Bison won't build with --enable-gcc-warnings as a 
result.

Paul Eggert | 9 Nov 21:55
Favicon

Re: lib/gettext.h breaks --enable-gcc-warnings

"Joel E. Denny" <jdenny <at> ces.clemson.edu> writes:

> Several functions in Gnulib's gettext.h don't use their domain and 
> category parameters.  Bison won't build with --enable-gcc-warnings as a 
> result.

Thanks for reporting this.  I reproduced the problem with CVS Bison by
configuring it with --enable-gcc-warnings.  Here are the symptoms:

        gcc -std=gnu99  -I. -I../lib  -I../lib  -Wall -Wextra -Wno-sign-compare -Wcast-align -Wcast-qual
-Wformat -Wpointer-arith -Wwrite-strings -Wbad-function-cast -Wmissing-declarations
-Wmissing-prototypes -Wshadow -Wstrict-prototypes -Werror -g -O2 -MT LR0.o -MD -MP -MF .deps/LR0.Tpo
-c -o LR0.o LR0.c
        cc1: warnings being treated as errors
        In file included from system.h:111,
                         from LR0.c:28:
        ../lib/gettext.h: In function 'pgettext_aux':
        ../lib/gettext.h:128: warning: unused parameter 'domain'
        ../lib/gettext.h:130: warning: unused parameter 'category'
        ../lib/gettext.h: In function 'npgettext_aux':
        ../lib/gettext.h:147: warning: unused parameter 'domain'
        ../lib/gettext.h:150: warning: unused parameter 'category'
        ../lib/gettext.h: In function 'dcpgettext_expr':
        ../lib/gettext.h:186: warning: unused parameter 'domain'
        ../lib/gettext.h:188: warning: unused parameter 'category'
        ../lib/gettext.h: In function 'dcnpgettext_expr':
        ../lib/gettext.h:231: warning: unused parameter 'domain'
        ../lib/gettext.h:234: warning: unused parameter 'category'
        make[2]: *** [LR0.o] Error 1
        make[2]: Leaving directory `/home/eggert/src/gnu/bison/src'
(Continue reading)

Joel E. Denny | 10 Nov 03:42

Re: lib/gettext.h breaks --enable-gcc-warnings

On Thu, 9 Nov 2006, Paul Eggert wrote:

> Here is a proposed patch to gnulib/lib/gettext.h, which works for me:
> 
> 2006-11-09  Paul Eggert  <eggert <at> cs.ucla.edu>
> 
> 	* lib/gettext.h (dgettext, dcgettext, ngettext) [! ENABLE_NLS]:
> 	(dngettext, dcngettext, bindtextdomain) [! ENABLE_NLS]:
> 	(bind_textdomain_codeset) [! ENABLE_NLS]:
> 	Evaluate all the arguments.  That way, callers get compatible
> 	behavior if the arguments have side effects.  Also, it avoids
> 	some GCC diagnostics in some cases; Joel E. Denny reported problems when
> 	Bison was configured with --enable-gcc-warnigs.

For what it's worth, it works for me too.

Bruno Haible | 10 Nov 15:48

Re: [bug-gnulib] lib/gettext.h breaks --enable-gcc-warnings

Paul Eggert wrote:
> 2006-11-09  Paul Eggert  <eggert <at> cs.ucla.edu>
> 
>         * lib/gettext.h (dgettext, dcgettext, ngettext) [! ENABLE_NLS]:
>         (dngettext, dcngettext, bindtextdomain) [! ENABLE_NLS]:
>         (bind_textdomain_codeset) [! ENABLE_NLS]:
>         Evaluate all the arguments.  That way, callers get compatible
>         behavior if the arguments have side effects.  Also, it avoids
>         some GCC diagnostics in some cases; Joel E. Denny reported problems when
>         Bison was configured with --enable-gcc-warnigs.

Thanks, applied in gnulib and GNU gettext.

Bruno

Hans Aberg | 13 Nov 13:30
Picon
Picon

C++ filename extension

The Bison generated C++ parser gets by default the header filename  
extension ".hh", though GCC seems to use ".h". The idea is not bad,  
but what is the rationale for using ".hh", and should it not perhaps  
be synced with the practice on GCC?

By contrast, using ".yy", though not very important, seems to break  
the idea that the extension name indicates the language of the file  
contents. - It is essentially the same input language.

   Hans Aberg


Gmane