[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gperf: Compile issues with CVS GCC
From: |
Bruno Haible |
Subject: |
gperf: Compile issues with CVS GCC |
Date: |
Sat, 31 Mar 2007 17:15:31 +0200 |
User-agent: |
KMail/1.5.4 |
Bruce Korb wrote in [1]:
> 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
Thank you very much for reporting this. The link failure can already be observed
with gperf's own testsuite:
$ export CC="gcc -std=gnu99"
$ export CXX=g++
$ ./configure
...
$ make
...
$ make check
...
gcc -std=gnu99 -g -O2 -o cout cinset.c test.o
cinset.c: In function 'in_word_set':
cinset.c:107: warning: 'hash' is static but used in inline function
'in_word_set' which is not static
test.o: In function `main':
./test.c:31: undefined reference to `in_word_set'
collect2: ld returned 1 exit status
make[1]: *** [check-link-c] Error 1
I'm applying this fix.
2007-03-31 Bruno Haible <address@hidden>
* src/output.cc (Output::output_lookup_function): Emit an inline
marker that also works with gcc-4.3 in c99 or gnu99 mode.
* tests/c-parse.exp, tests/charsets.exp, tests/chill.exp,
tests/cplusplus.exp, tests/gpc.exp, tests/incomplete.exp,
tests/java.exp, tests/languages.exp, tests/modula2.exp,
tests/objc.exp, tests/permut2.exp, tests/permut3.exp,
tests/permutc2.exp, tests/test-4.exp: Update.
Reported by Bruce Korb <address@hidden>.
*** src/output.cc 13 Jan 2006 13:11:19 -0000 1.36
--- src/output.cc 31 Mar 2007 15:13:10 -0000
***************
*** 1,5 ****
/* Output routines.
! Copyright (C) 1989-1998, 2000, 2002-2004, 2006 Free Software Foundation,
Inc.
Written by Douglas C. Schmidt <address@hidden>
and Bruno Haible <address@hidden>.
--- 1,5 ----
/* Output routines.
! Copyright (C) 1989-1998, 2000, 2002-2004, 2006-2007 Free Software
Foundation, Inc.
Written by Douglas C. Schmidt <address@hidden>
and Bruno Haible <address@hidden>.
***************
*** 1884,1891 ****
--- 1884,1897 ----
{
/* Output the function's head. */
if (option[KRC] | option[C] | option[ANSIC])
+ /* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99
+ inline semantics, unless -fgnu89-inline is used. It defines a macro
+ __GNUC_STDC_INLINE__ to indicate this situation. */
printf ("#ifdef __GNUC__\n"
"__inline\n"
+ "#ifdef __GNUC_STDC_INLINE__\n"
+ "__attribute__ ((__gnu_inline__))\n"
+ "#endif\n"
"#endif\n");
printf ("%s%s\n",
*** tests/c-parse.exp 30 Jul 2005 16:42:13 -0000 1.13
--- tests/c-parse.exp 31 Mar 2007 15:13:10 -0000
***************
*** 199,204 ****
--- 199,207 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct resword *
is_reserved_word (str, len)
*** tests/charsets.exp 30 Jul 2005 16:42:13 -0000 1.7
--- tests/charsets.exp 31 Mar 2007 15:13:10 -0000
***************
*** 1805,1810 ****
--- 1805,1813 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
const struct charset *
in_word_set (str, len)
*** tests/chill.exp 30 Jul 2005 16:42:13 -0000 1.14
--- tests/chill.exp 31 Mar 2007 15:13:11 -0000
***************
*** 178,183 ****
--- 178,186 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct resword *
in_word_set (str, len)
*** tests/cplusplus.exp 30 Jul 2005 16:42:13 -0000 1.12
--- tests/cplusplus.exp 31 Mar 2007 15:13:11 -0000
***************
*** 103,108 ****
--- 103,111 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct resword *
is_reserved_word (str, len)
*** tests/gpc.exp 30 Jul 2005 16:42:13 -0000 1.10
--- tests/gpc.exp 31 Mar 2007 15:13:11 -0000
***************
*** 94,99 ****
--- 94,102 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct resword *
is_reserved_word (str, len)
*** tests/incomplete.exp 30 Jul 2005 16:42:13 -0000 1.3
--- tests/incomplete.exp 31 Mar 2007 15:13:11 -0000
***************
*** 84,89 ****
--- 84,92 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct month *
in_word_set (str, len)
*** tests/java.exp 30 Jul 2005 16:42:13 -0000 1.13
--- tests/java.exp 31 Mar 2007 15:13:11 -0000
***************
*** 121,126 ****
--- 121,129 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct java_keyword *
java_keyword (str, len)
*** tests/languages.exp 30 Jul 2005 16:42:13 -0000 1.7
--- tests/languages.exp 31 Mar 2007 15:13:11 -0000
***************
*** 1462,1467 ****
--- 1462,1470 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
const struct language *
in_word_set (str, len)
*** tests/modula2.exp 30 Jul 2005 16:42:13 -0000 1.9
--- tests/modula2.exp 31 Mar 2007 15:13:11 -0000
***************
*** 111,116 ****
--- 111,119 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
const char *
in_word_set (str, len)
*** tests/objc.exp 30 Jul 2005 16:42:13 -0000 1.12
--- tests/objc.exp 31 Mar 2007 15:13:11 -0000
***************
*** 97,102 ****
--- 97,105 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct resword *
is_reserved_word (str, len)
*** tests/permut2.exp 30 Jul 2005 16:42:13 -0000 1.5
--- tests/permut2.exp 31 Mar 2007 15:13:11 -0000
***************
*** 83,88 ****
--- 83,91 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
const char *
in_word_set (str, len)
*** tests/permut3.exp 30 Jul 2005 16:42:13 -0000 1.5
--- tests/permut3.exp 31 Mar 2007 15:13:11 -0000
***************
*** 83,88 ****
--- 83,91 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
const char *
in_word_set (str, len)
*** tests/permutc2.exp 30 Jul 2005 16:42:13 -0000 1.7
--- tests/permutc2.exp 31 Mar 2007 15:13:11 -0000
***************
*** 130,135 ****
--- 130,138 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
const char *
in_word_set (str, len)
*** tests/test-4.exp 30 Jul 2005 16:42:13 -0000 1.11
--- tests/test-4.exp 31 Mar 2007 15:13:11 -0000
***************
*** 85,90 ****
--- 85,93 ----
#ifdef __GNUC__
__inline
+ #ifdef __GNUC_STDC_INLINE__
+ __attribute__ ((__gnu_inline__))
+ #endif
#endif
struct resword *
in_word_set (str, len)
[1] http://lists.gnu.org/archive/html/bug-gnu-utils/2007-03/msg00035.html