summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2018-09-09 01:14:20 +0200
committerBruno Haible <bruno@clisp.org>2018-09-09 01:14:20 +0200
commit50840436d5df8692d2d730be759d2a007948a044 (patch)
tree42a1c7a232fc4f17eb49b8921a532137f8e8fe4d
parent11487a61ce8a90f29c078dffc576e42cad24b789 (diff)
downloadgperf-50840436d5df8692d2d730be759d2a007948a044.tar.gz
Avoid "implicit fallthrough" warnings also from clang.
-rw-r--r--ChangeLog16
-rw-r--r--src/output.cc2
-rw-r--r--tests/c-parse.exp2
-rw-r--r--tests/charsets.exp22
-rw-r--r--tests/chill.exp58
-rw-r--r--tests/cplusplus.exp4
-rw-r--r--tests/java.exp2
-rw-r--r--tests/languages.exp6
-rw-r--r--tests/modula2.exp14
-rw-r--r--tests/objc.exp2
10 files changed, 72 insertions, 56 deletions
diff --git a/ChangeLog b/ChangeLog
index 023d3bc..268d5c7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
2018-09-08 Bruno Haible <bruno@clisp.org>
+ Avoid "implicit fallthrough" warnings also from clang.
+ Reported by Nico Weber <thakis@chromium.org> in
+ <https://savannah.gnu.org/bugs/?53029>.
+ Clang emits these warnings in C++11 mode only, see
+ <https://clang.llvm.org/docs/AttributeReference.html#fallthrough>,
+ and only in clang 3.9 or newer, see
+ <http://releases.llvm.org/3.9.0/tools/clang/docs/ReleaseNotes.html>.
+ To avoid them, either [[fallthrough]] or the (nearly equivalent) older
+ [[clang::fallthrough]] can be used, see
+ <http://llvm.org/viewvc/llvm-project?view=revision&revision=262881>.
+ * src/output.cc (Output::output_hash_function): Enhance the fallthrough
+ marker.
+ * tests/*.exp: Update.
+
+2018-09-08 Bruno Haible <bruno@clisp.org>
+
Fix failure of "make check -j2".
Reported and fix provided by Bernhard M. Wiedemann in
<https://savannah.gnu.org/bugs/?53208>.
diff --git a/src/output.cc b/src/output.cc
index 2539fde..5c62828 100644
--- a/src/output.cc
+++ b/src/output.cc
@@ -937,7 +937,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\n"
+ "#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))\n"
" [[fallthrough]];\n"
"#elif defined __GNUC__ && __GNUC__ >= 7\n"
" __attribute__ ((__fallthrough__));\n"
diff --git a/tests/c-parse.exp b/tests/c-parse.exp
index d88878c..9294294 100644
--- a/tests/c-parse.exp
+++ b/tests/c-parse.exp
@@ -86,7 +86,7 @@ hash (str, len)
{
default:
hval += asso_values[(unsigned char)str[2]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
diff --git a/tests/charsets.exp b/tests/charsets.exp
index 4af888f..afc8b88 100644
--- a/tests/charsets.exp
+++ b/tests/charsets.exp
@@ -93,7 +93,7 @@ hash (register const char *str, register size_t len)
{
default:
hval += asso_values[(unsigned char)str[21]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -111,7 +111,7 @@ hash (register const char *str, register size_t len)
case 12:
case 11:
hval += asso_values[(unsigned char)str[10]+1];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -119,7 +119,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 10:
hval += asso_values[(unsigned char)str[9]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -127,7 +127,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 9:
hval += asso_values[(unsigned char)str[8]+1];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -135,7 +135,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 8:
hval += asso_values[(unsigned char)str[7]+3];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -143,7 +143,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 7:
hval += asso_values[(unsigned char)str[6]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -151,7 +151,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 6:
hval += asso_values[(unsigned char)str[5]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -159,7 +159,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 5:
hval += asso_values[(unsigned char)str[4]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -167,7 +167,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 4:
hval += asso_values[(unsigned char)str[3]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -175,7 +175,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 3:
hval += asso_values[(unsigned char)str[2]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -183,7 +183,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 2:
hval += asso_values[(unsigned char)str[1]+1];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
diff --git a/tests/chill.exp b/tests/chill.exp
index 3fc858a..4f7e373 100644
--- a/tests/chill.exp
+++ b/tests/chill.exp
@@ -84,7 +84,7 @@ hash (str, len)
{
default:
hval += asso_values[(unsigned char)str[29]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -92,7 +92,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 29:
hval += asso_values[(unsigned char)str[28]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -100,7 +100,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 28:
hval += asso_values[(unsigned char)str[27]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -108,7 +108,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 27:
hval += asso_values[(unsigned char)str[26]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -116,7 +116,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 26:
hval += asso_values[(unsigned char)str[25]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -124,7 +124,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 25:
hval += asso_values[(unsigned char)str[24]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -132,7 +132,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 24:
hval += asso_values[(unsigned char)str[23]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -140,7 +140,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 23:
hval += asso_values[(unsigned char)str[22]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -148,7 +148,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 22:
hval += asso_values[(unsigned char)str[21]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -156,7 +156,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 21:
hval += asso_values[(unsigned char)str[20]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -164,7 +164,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 20:
hval += asso_values[(unsigned char)str[19]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -172,7 +172,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 19:
hval += asso_values[(unsigned char)str[18]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -180,7 +180,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 18:
hval += asso_values[(unsigned char)str[17]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -188,7 +188,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 17:
hval += asso_values[(unsigned char)str[16]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -196,7 +196,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 16:
hval += asso_values[(unsigned char)str[15]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -204,7 +204,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 15:
hval += asso_values[(unsigned char)str[14]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -212,7 +212,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 14:
hval += asso_values[(unsigned char)str[13]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -220,7 +220,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 13:
hval += asso_values[(unsigned char)str[12]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -228,7 +228,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 12:
hval += asso_values[(unsigned char)str[11]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -236,7 +236,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 11:
hval += asso_values[(unsigned char)str[10]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -244,7 +244,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 10:
hval += asso_values[(unsigned char)str[9]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -252,7 +252,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 9:
hval += asso_values[(unsigned char)str[8]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -260,7 +260,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 8:
hval += asso_values[(unsigned char)str[7]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -268,7 +268,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 7:
hval += asso_values[(unsigned char)str[6]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -276,7 +276,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 6:
hval += asso_values[(unsigned char)str[5]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -284,7 +284,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 5:
hval += asso_values[(unsigned char)str[4]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -292,7 +292,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 4:
hval += asso_values[(unsigned char)str[3]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -300,7 +300,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 3:
hval += asso_values[(unsigned char)str[2]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -308,7 +308,7 @@ hash (str, len)
/*FALLTHROUGH*/
case 2:
hval += asso_values[(unsigned char)str[1]+1];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
diff --git a/tests/cplusplus.exp b/tests/cplusplus.exp
index 20c4471..3e4f181 100644
--- a/tests/cplusplus.exp
+++ b/tests/cplusplus.exp
@@ -86,7 +86,7 @@ hash (str, len)
{
default:
hval += asso_values[(unsigned char)str[6]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -96,7 +96,7 @@ hash (str, len)
case 5:
case 4:
hval += asso_values[(unsigned char)str[3]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
diff --git a/tests/java.exp b/tests/java.exp
index 7176106..bce452b 100644
--- a/tests/java.exp
+++ b/tests/java.exp
@@ -110,7 +110,7 @@ hash (str, len)
{
default:
hval += asso_values[(unsigned char)str[2]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
diff --git a/tests/languages.exp b/tests/languages.exp
index 36d36d7..88b84c7 100644
--- a/tests/languages.exp
+++ b/tests/languages.exp
@@ -97,7 +97,7 @@ hash (register const char *str, register size_t len)
{
default:
hval += asso_values[(unsigned char)str[4]+1];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -106,7 +106,7 @@ hash (register const char *str, register size_t len)
case 4:
case 3:
hval += asso_values[(unsigned char)str[2]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -114,7 +114,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 2:
hval += asso_values[(unsigned char)str[1]+9];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
diff --git a/tests/modula2.exp b/tests/modula2.exp
index 658223b..4a622fd 100644
--- a/tests/modula2.exp
+++ b/tests/modula2.exp
@@ -81,7 +81,7 @@ hash (register const char *str, register size_t len)
{
default:
hval += asso_values[(unsigned char)str[7]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -89,7 +89,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 7:
hval += asso_values[(unsigned char)str[6]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -97,7 +97,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 6:
hval += asso_values[(unsigned char)str[5]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -105,7 +105,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 5:
hval += asso_values[(unsigned char)str[4]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -113,7 +113,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 4:
hval += asso_values[(unsigned char)str[3]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -121,7 +121,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 3:
hval += asso_values[(unsigned char)str[2]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
@@ -129,7 +129,7 @@ hash (register const char *str, register size_t len)
/*FALLTHROUGH*/
case 2:
hval += asso_values[(unsigned char)str[1]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));
diff --git a/tests/objc.exp b/tests/objc.exp
index 379e668..3d7b16c 100644
--- a/tests/objc.exp
+++ b/tests/objc.exp
@@ -84,7 +84,7 @@ hash (register const char *str, register size_t len)
{
default:
hval += asso_values[(unsigned char)str[2]];
-#if defined __cplusplus && __cplusplus >= 201703L
+#if defined __cplusplus && (__cplusplus >= 201703L || (__cplusplus >= 201103L && defined __clang_major__ && defined __clang_minor__ && __clang_major__ + (__clang_minor__ >= 9) > 3))
[[fallthrough]];
#elif defined __GNUC__ && __GNUC__ >= 7
__attribute__ ((__fallthrough__));