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:
@@ -106,7 +106,7 @@ hash (str, len)
|
||||
{
|
||||
default:
|
||||
hval += asso_values[(unsigned char)str[2]];
|
||||
#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)))
|
||||
#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)))
|
||||
[[fallthrough]];
|
||||
#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
|
||||
__attribute__ ((__fallthrough__));
|
||||
|
||||
Reference in New Issue
Block a user