bug-grub
[Top][All Lists]
Advanced

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

Re: Patch proposal for YYENABLE_NLS warning


From: James Linden
Subject: Re: Patch proposal for YYENABLE_NLS warning
Date: Wed, 28 May 2008 08:53:00 -0400
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

Bean wrote:
On Wed, May 28, 2008 at 9:39 AM, James Linden <address@hidden> wrote:
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. :-)

grub_script.tab.c is auto generated from parser.y, it makes no sense
to modify it directly, as it will be overwritten by bison.
That would be a flaw in the logic... LOL.

I'm able to reproduce the warning using CVS code...

Regards,
     James 'KodeKrash' Linden
     address@hidden
     http://www.jameslinden.com/





reply via email to

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