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

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

gperf: Compile issues with CVS GCC


From: Bruce Korb
Subject: gperf: Compile issues with CVS GCC
Date: Sat, 24 Mar 2007 17:21:29 -0700
User-agent: Thunderbird 1.5.0.8 (X11/20060911)

Hi,

The output language is apparently not up-to-snuff enough for -std=gnu99:

$ /home/gnu/proj/gcc-main/_i/bin/gcc -std=gnu99 -g    gperf.c   -o gperf
gperf.gperf: In function 'gperf_find':
gperf.gperf:65: warning: 'wordlist' is static but declared in inline function 
'gperf_find' which is not static
gperf.gperf:14: warning: 'gperf_hash' is static but used in inline function 
'gperf_find' which is not static
gperf.gperf:18: warning: 'wordlist' is static but used in inline function 
'gperf_find' which is not static
gperf.gperf:21: warning: 'wordlist' is static but used in inline function 
'gperf_find' which is not static
gperf.gperf: In function 'main':
gperf.gperf:13: warning: initialization discards qualifiers from pointer target 
type
/local/tmp/ccGsTRmU.o: In function `main':
/home/bkorb/ag/ag/agen5/test/FAILURES/.gperf.S13103/gperf.gperf:13: undefined 
reference to `gperf_find'
collect2: ld returned 1 exit status
/home/bkorb/ag/ag/agen5/test/FAILURES/.gperf.S13103

$ /home/gnu/proj/gcc-main/_i/bin/gcc -g    gperf.c   -o gperf
gperf.gperf: In function 'main':
gperf.gperf:13: warning: initialization discards qualifiers from pointer target 
ty

In case this helps, the command to create gperf.c:

gperf --language=ANSI-C -H gperf_hash -N gperf_find --null-strings \
      -C -E -I -t gperf.gperf > gperf.c

and the input is pretty simple:

%{
#include <stdio.h>
%}
struct gperf_index { char const * name; int const idx; };
%%
first, 1
second, 2
third, 3
fourth, 4
%%

I won't bore you with all the output.  The part at issue is:


#ifdef __GNUC__
__inline
#endif
const struct gperf_index *
gperf_find (register const char *str, register unsigned int len)
{
  enum.....

  static const struct gperf_index wordlist[] =
    {
      {(char*)0}, {(char*)0}, {(char*)0}, {(char*)0},
      {(char*)0},
#line 8 "gperf.gperf"
      {"third", 3},
#line 7 "gperf.gperf"
      {"second", 2},
      {(char*)0}, {(char*)0}, {(char*)0},
#line 6 "gperf.gperf"
      {"first", 1},
#line 9 "gperf.gperf"
      {"fourth", 4}
    };




reply via email to

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