mirror of
https://git.savannah.gnu.org/git/gperf.git
synced 2025-12-02 13:09:22 +00:00
Avoid "implicit fallthrough" warnings in the generated code.
This commit is contained in:
@@ -81,24 +81,59 @@ hash (register const char *str, register size_t len)
|
||||
{
|
||||
default:
|
||||
hval += asso_values[(unsigned char)str[7]];
|
||||
#if defined __cplusplus && __cplusplus >= 201703L
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case 7:
|
||||
hval += asso_values[(unsigned char)str[6]];
|
||||
#if defined __cplusplus && __cplusplus >= 201703L
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case 6:
|
||||
hval += asso_values[(unsigned char)str[5]];
|
||||
#if defined __cplusplus && __cplusplus >= 201703L
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case 5:
|
||||
hval += asso_values[(unsigned char)str[4]];
|
||||
#if defined __cplusplus && __cplusplus >= 201703L
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case 4:
|
||||
hval += asso_values[(unsigned char)str[3]];
|
||||
#if defined __cplusplus && __cplusplus >= 201703L
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case 3:
|
||||
hval += asso_values[(unsigned char)str[2]];
|
||||
#if defined __cplusplus && __cplusplus >= 201703L
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case 2:
|
||||
hval += asso_values[(unsigned char)str[1]];
|
||||
#if defined __cplusplus && __cplusplus >= 201703L
|
||||
[[fallthrough]];
|
||||
#elif defined __GNUC__ && __GNUC__ >= 7
|
||||
__attribute__ ((__fallthrough__));
|
||||
#endif
|
||||
/*FALLTHROUGH*/
|
||||
case 1:
|
||||
hval += asso_values[(unsigned char)str[0]];
|
||||
|
||||
Reference in New Issue
Block a user