mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 13:09:22 +00:00
Avoid "clang -Wimplicit-fallthrough" warnings also in C mode.
* src/output.cc (Output::output_hash_function): Enhance the fallthrough marker, to include clang >= 10 in C mode. * tests/*.exp: Update.
This commit is contained in:
@@ -86,9 +86,9 @@ hash (str, len)
|
||||
{
|
||||
default:
|
||||
hval += asso_values[(unsigned char)str[6]];
|
||||
#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
|
||||
#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)))
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
@@ -96,9 +96,9 @@ hash (str, len)
|
||||
case 5:
|
||||
case 4:
|
||||
hval += asso_values[(unsigned char)str[3]];
|
||||
#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
|
||||
#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)))
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
#elif (defined __GNUC__ && __GNUC__ >= 7) || (defined __clang__ && __clang_major__ >= 10)
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
|
||||
Reference in New Issue
Block a user