1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Change generated code to avoid a warning by GCC 4.2.

This commit is contained in:
Bruno Haible
2007-09-09 02:05:32 +00:00
parent 597eaaa4ab
commit fc599936bd
16 changed files with 35 additions and 16 deletions

View File

@@ -1,3 +1,16 @@
2007-09-08 Bruno Haible <bruno@clisp.org>
Change generated code to avoid a warning by GCC 4.2 that the meaning
of __inline will be changed (!).
* src/output.cc (Output::output_lookup_function): Emit the inline
marker also for gcc-4.2 in c99 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 Jim Meyering <jim@meyering.net>.
2007-09-08 Bruno Haible <bruno@clisp.org> 2007-09-08 Bruno Haible <bruno@clisp.org>
Allow creating the HTML documentation with texi2html or makeinfo. Allow creating the HTML documentation with texi2html or makeinfo.

View File

@@ -1886,10 +1886,16 @@ Output::output_lookup_function () const
if (option[KRC] | option[C] | option[ANSIC]) if (option[KRC] | option[C] | option[ANSIC])
/* GCC 4.3 and above with -std=c99 or -std=gnu99 implements ISO C99 /* 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 inline semantics, unless -fgnu89-inline is used. It defines a macro
__GNUC_STDC_INLINE__ to indicate this situation. */ __GNUC_STDC_INLINE__ to indicate this situation or a macro
__GNUC_GNU_INLINE__ to indicate the opposite situation.
GCC 4.2 with -std=c99 or -std=gnu99 implements the GNU C inline
semantics but warns, unless -fgnu89-inline is used:
warning: C99 inline functions are not supported; using GNU89
warning: to disable this warning use -fgnu89-inline or the gnu_inline function attribute
It defines a macro __GNUC_GNU_INLINE__ to indicate this situation. */
printf ("#ifdef __GNUC__\n" printf ("#ifdef __GNUC__\n"
"__inline\n" "__inline\n"
"#ifdef __GNUC_STDC_INLINE__\n" "#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__\n"
"__attribute__ ((__gnu_inline__))\n" "__attribute__ ((__gnu_inline__))\n"
"#endif\n" "#endif\n"
"#endif\n"); "#endif\n");

View File

@@ -199,7 +199,7 @@ static struct resword wordlist[] =
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -1805,7 +1805,7 @@ static const struct charset wordlist[] =
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -178,7 +178,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -103,7 +103,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -94,7 +94,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -84,7 +84,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -121,7 +121,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -1462,7 +1462,7 @@ static const struct language wordlist[] =
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -111,7 +111,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -97,7 +97,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -83,7 +83,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -83,7 +83,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -130,7 +130,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif

View File

@@ -85,7 +85,7 @@ hash (str, len)
#ifdef __GNUC__ #ifdef __GNUC__
__inline __inline
#ifdef __GNUC_STDC_INLINE__ #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
__attribute__ ((__gnu_inline__)) __attribute__ ((__gnu_inline__))
#endif #endif
#endif #endif