mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 13:09:22 +00:00
Avoid "-Wundef" warnings in C++ mode on the generated code.
Reported by Heiko Becker <mail@heiko-becker.de> in <https://lists.gnu.org/archive/html/bug-gperf/2025-04/msg00001.html> and by Thomas Klausner <wiz@netbsd.org>. * src/output.cc (Output::output_hash_function): Emit a 'defined __STDC_VERSION__' before the test of __STDC_VERSION__. * tests/c-parse.exp, tests/charsets.exp, tests/chill.exp, tests/cplusplus.exp, tests/java.exp, tests/languages.exp, tests/modula2.exp, tests/objc.exp: Update.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/* Output routines.
|
||||
Copyright (C) 1989-2024 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989-2025 Free Software Foundation, Inc.
|
||||
Written by Douglas C. Schmidt <schmidt@ics.uci.edu>
|
||||
and Bruno Haible <bruno@clisp.org>.
|
||||
|
||||
@@ -953,7 +953,7 @@ Output::output_hash_function () const
|
||||
/* Pseudo-statement or comment that avoids a compiler warning or
|
||||
lint warning. */
|
||||
const char * const fallthrough_marker =
|
||||
"#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (__STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n"
|
||||
"#if (defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang__ && __clang_major__ + (__clang_minor__ >= 9) > 3))) || (defined __STDC_VERSION__ && __STDC_VERSION__ >= 202000L && ((defined __GNUC__ && __GNUC__ >= 10) || (defined __clang__ && __clang_major__ >= 9)))\n"
|
||||
" [[fallthrough]];\n"
|
||||
"#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)\n"
|
||||
" __attribute__ ((__fallthrough__));\n"
|
||||
|
||||
Reference in New Issue
Block a user