diff options
author | Bruno Haible <bruno@clisp.org> | 2007-03-31 15:16:05 +0000 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2007-03-31 15:16:05 +0000 |
commit | 0e4abdfd81e11c2bb8793a4f8d7c7636b948bad9 (patch) | |
tree | 25544fea711675f97074990103befe7f6b9ab2a8 | |
parent | 89f5335289220036d0bc050d1cffd87be2202614 (diff) | |
download | gperf-0e4abdfd81e11c2bb8793a4f8d7c7636b948bad9.tar.gz |
Change generated code after the meaning of __inline is changed in GCC 4.3.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | src/output.cc | 8 | ||||
-rw-r--r-- | tests/c-parse.exp | 3 | ||||
-rw-r--r-- | tests/charsets.exp | 3 | ||||
-rw-r--r-- | tests/chill.exp | 3 | ||||
-rw-r--r-- | tests/cplusplus.exp | 3 | ||||
-rw-r--r-- | tests/gpc.exp | 3 | ||||
-rw-r--r-- | tests/incomplete.exp | 3 | ||||
-rw-r--r-- | tests/java.exp | 3 | ||||
-rw-r--r-- | tests/languages.exp | 3 | ||||
-rw-r--r-- | tests/modula2.exp | 3 | ||||
-rw-r--r-- | tests/objc.exp | 3 | ||||
-rw-r--r-- | tests/permut2.exp | 3 | ||||
-rw-r--r-- | tests/permut3.exp | 3 | ||||
-rw-r--r-- | tests/permutc2.exp | 3 | ||||
-rw-r--r-- | tests/test-4.exp | 3 |
17 files changed, 66 insertions, 1 deletions
@@ -1,3 +1,16 @@ +2007-03-31 Bruno Haible <bruno@clisp.org> + + 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 <Bruce.Korb@gmail.com>. + 2006-06-29 Brendan Kehoe <brendan@zen.org> * gperf-3.0.2 released. @@ -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 <schmidt@ics.uci.edu> and Bruno Haible <bruno@clisp.org>. @@ -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) |