[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch proposal for YYENABLE_NLS warning
From: |
James Linden |
Subject: |
Patch proposal for YYENABLE_NLS warning |
Date: |
Tue, 27 May 2008 21:39:58 -0400 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080226) |
Description:
This is a simple compiler warning, but it could be an early
indication of a forthcoming bug? When compiling grub, a warning is
generated that YYENABLE_NLS is not defined. Grub code is attempting to
use that before checking to see if it is defined or not. Unless I'm
missing something, the proper thing to do is to simply wrap the
statement in an ifdef/endif directive...
The situation is reproducible within the environment numerous times
when bison is compiled '--disable-nls'. When bison is compiled with
'--enable-nls', this warning does not appear. Most distributions will
have '--enable-nls', except in rare cases, such as mine, where NLS is
not desired.
Environment:
grub: 1.96
bison: 2.3
kernel: 2.6.25.2
gcc: 4.3.0
glibc: 2.7
make: 3.81
Situation:
bison is compiled with '--disable-nls'
grub compile issues a warning:
grub_script.tab.c:197:6: warning: "YYENABLE_NLS" is not defined
Current code:
#ifndef YY_
# if YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# endif
#endif
Proposed change:
#ifndef YY_
# ifdef YYENABLE_NLS
# if YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
# define YY_(msgid) dgettext ("bison-runtime", msgid)
# endif
# endif
# endif
# ifndef YY_
# define YY_(msgid) msgid
# endif
#endif
I will provide actual patch if no one points out any flaws in the logic. :-)
Regards,
James 'KodeKrash' Linden
address@hidden
http://www.jameslinden.com/
- Patch proposal for YYENABLE_NLS warning,
James Linden <=