bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: [Gperf-bugs] gperf 3.0 generates invalid code


From: Bruno Haible
Subject: Re: [Gperf-bugs] gperf 3.0 generates invalid code
Date: Mon, 2 Jun 2003 16:19:22 +0200 (CEST)

Hi,

Rob Leslie wrote:
> The following input:
> 
> struct foo;
> %%
> one, 1
> two, 2
> 
> when given to 'gperf -t' generates the following invalid code:
> 
> ...
> struct foo; *
> in_word_set (str, len)
>       register const char *str;
>       register unsigned int len;
> {
>    static struct foo; wordlist[] =
> ...
> 
> This was not a problem with gperf 2.7.2.

Thanks for reporting this. I wasn't aware that some people were using
gperf this way (since the usability of an abbreviated declaration
"struct foo;" was not documented).

It will be fixed in gperf-3.0.1, through this patch.

Bruno


diff -r -c3 --exclude='*.ps' --exclude='*.html' --exclude='*.info' 
--exclude=configure --exclude=gperf.1 gperf-cvs/src/input.cc 
gperf-work/src/input.cc
*** gperf-cvs/src/input.cc      2003-03-19 14:10:53.000000000 +0100
--- gperf-work/src/input.cc     2003-05-31 13:49:44.000000000 +0200
***************
*** 713,719 ****
          _struct_decl = struct_decl;
          /* Set _struct_tag to the naked "struct something".  */
          const char *p;
!         for (p = struct_decl; *p && *p != '{' && *p != '\n'; p++)
            ;
          for (; p > struct_decl;)
            if (p[-1] == '\n' || p[-1] == ' ' || p[-1] == '\t')
--- 713,719 ----
          _struct_decl = struct_decl;
          /* Set _struct_tag to the naked "struct something".  */
          const char *p;
!         for (p = struct_decl; *p && *p != '{' && *p != ';' && *p != '\n'; p++)
            ;
          for (; p > struct_decl;)
            if (p[-1] == '\n' || p[-1] == ' ' || p[-1] == '\t')




reply via email to

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