From 0e4abdfd81e11c2bb8793a4f8d7c7636b948bad9 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 31 Mar 2007 15:16:05 +0000 Subject: Change generated code after the meaning of __inline is changed in GCC 4.3. --- ChangeLog | 13 +++++++++++++ NEWS | 4 ++++ src/output.cc | 8 +++++++- tests/c-parse.exp | 3 +++ tests/charsets.exp | 3 +++ tests/chill.exp | 3 +++ tests/cplusplus.exp | 3 +++ tests/gpc.exp | 3 +++ tests/incomplete.exp | 3 +++ tests/java.exp | 3 +++ tests/languages.exp | 3 +++ tests/modula2.exp | 3 +++ tests/objc.exp | 3 +++ tests/permut2.exp | 3 +++ tests/permut3.exp | 3 +++ tests/permutc2.exp | 3 +++ tests/test-4.exp | 3 +++ 17 files changed, 66 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1f8da0d..1b4ebeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2007-03-31 Bruno Haible + + Change generated code after the meaning of __inline is changed in + GCC 4.3. + * 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 . + 2006-06-29 Brendan Kehoe * gperf-3.0.2 released. diff --git a/NEWS b/NEWS index 4847c39..dddf427 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +New in 3.0.3: + +* The generated C code is compatible with gcc-4.3.x in c99 or gnu99 mode. + New in 3.0.2: * Compiles with g++-4.0.x. diff --git a/src/output.cc b/src/output.cc index d409ab4..c0c8e6c 100644 --- a/src/output.cc +++ b/src/output.cc @@ -1,5 +1,5 @@ /* Output routines. - Copyright (C) 1989-1998, 2000, 2002-2004, 2006 Free Software Foundation, Inc. + Copyright (C) 1989-1998, 2000, 2002-2004, 2006-2007 Free Software Foundation, Inc. Written by Douglas C. Schmidt and Bruno Haible . @@ -1884,8 +1884,14 @@ Output::output_lookup_function () const { /* 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", diff --git a/tests/c-parse.exp b/tests/c-parse.exp index 1388af9..d2bccc7 100644 --- a/tests/c-parse.exp +++ b/tests/c-parse.exp @@ -199,6 +199,9 @@ static struct resword wordlist[] = #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct resword * is_reserved_word (str, len) diff --git a/tests/charsets.exp b/tests/charsets.exp index f41a24e..63a3b9f 100644 --- a/tests/charsets.exp +++ b/tests/charsets.exp @@ -1805,6 +1805,9 @@ static const struct charset wordlist[] = #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const struct charset * in_word_set (str, len) diff --git a/tests/chill.exp b/tests/chill.exp index 4478e8e..6bc061d 100644 --- a/tests/chill.exp +++ b/tests/chill.exp @@ -178,6 +178,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct resword * in_word_set (str, len) diff --git a/tests/cplusplus.exp b/tests/cplusplus.exp index 2e35282..125a18a 100644 --- a/tests/cplusplus.exp +++ b/tests/cplusplus.exp @@ -103,6 +103,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct resword * is_reserved_word (str, len) diff --git a/tests/gpc.exp b/tests/gpc.exp index 1b48421..e754a27 100644 --- a/tests/gpc.exp +++ b/tests/gpc.exp @@ -94,6 +94,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct resword * is_reserved_word (str, len) diff --git a/tests/incomplete.exp b/tests/incomplete.exp index 35be089..dadb4ea 100644 --- a/tests/incomplete.exp +++ b/tests/incomplete.exp @@ -84,6 +84,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct month * in_word_set (str, len) diff --git a/tests/java.exp b/tests/java.exp index 3681abd..1e77df6 100644 --- a/tests/java.exp +++ b/tests/java.exp @@ -121,6 +121,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct java_keyword * java_keyword (str, len) diff --git a/tests/languages.exp b/tests/languages.exp index 84e6fdf..ed0b29a 100644 --- a/tests/languages.exp +++ b/tests/languages.exp @@ -1462,6 +1462,9 @@ static const struct language wordlist[] = #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const struct language * in_word_set (str, len) diff --git a/tests/modula2.exp b/tests/modula2.exp index 7133e04..233445e 100644 --- a/tests/modula2.exp +++ b/tests/modula2.exp @@ -111,6 +111,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const char * in_word_set (str, len) diff --git a/tests/objc.exp b/tests/objc.exp index def296b..5a29457 100644 --- a/tests/objc.exp +++ b/tests/objc.exp @@ -97,6 +97,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct resword * is_reserved_word (str, len) diff --git a/tests/permut2.exp b/tests/permut2.exp index 9016cfb..c7521e2 100644 --- a/tests/permut2.exp +++ b/tests/permut2.exp @@ -83,6 +83,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const char * in_word_set (str, len) diff --git a/tests/permut3.exp b/tests/permut3.exp index 0d8f9f4..56d54c5 100644 --- a/tests/permut3.exp +++ b/tests/permut3.exp @@ -83,6 +83,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const char * in_word_set (str, len) diff --git a/tests/permutc2.exp b/tests/permutc2.exp index bb0377d..a684d4f 100644 --- a/tests/permutc2.exp +++ b/tests/permutc2.exp @@ -130,6 +130,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif const char * in_word_set (str, len) diff --git a/tests/test-4.exp b/tests/test-4.exp index 2c6b291..d35ada7 100644 --- a/tests/test-4.exp +++ b/tests/test-4.exp @@ -85,6 +85,9 @@ hash (str, len) #ifdef __GNUC__ __inline +#ifdef __GNUC_STDC_INLINE__ +__attribute__ ((__gnu_inline__)) +#endif #endif struct resword * in_word_set (str, len) -- cgit v1.2.1