summaryrefslogtreecommitdiff
path: root/config/eu.am
diff options
context:
space:
mode:
authorTimm Bäder <tbaeder@redhat.com>2021-02-17 10:27:06 +0100
committerMark Wielaard <mark@klomp.org>2021-03-01 23:46:20 +0100
commitd6c85cff9df027ea3972f021d674f96b9bd9d9db (patch)
tree34158f6a2d5f96e2b2fd9f9a8bf62f2841b20aea /config/eu.am
parent5e77688768575f8cdf978c726403a56a09789a3c (diff)
downloadelfutils-d6c85cff9df027ea3972f021d674f96b9bd9d9db.tar.gz
build: Check for -Wimplicit-fallthrough=5 separately
GCC accepts the =5, which means it doesn't try to parse any comments and only accepts the fallthrough attribute in code. Clang does not ever parse any comments and always wants the fallthrough attribute anyway. Clang also doesn't accept the =n parameter for -Wimplicit-fallthrough. Test for =5 separately and use it if supported and fall back to just -Wimplicit-fallthrough otherwise. Signed-off-by: Timm Bäder <tbaeder@redhat.com>
Diffstat (limited to 'config/eu.am')
-rw-r--r--config/eu.am4
1 files changed, 4 insertions, 0 deletions
diff --git a/config/eu.am b/config/eu.am
index 6c3c444f..e109ffd3 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -64,8 +64,12 @@ endif
if HAVE_IMPLICIT_FALLTHROUGH_WARNING
# Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the
# warning
+if HAVE_IMPLICIT_FALLTHROUGH_5_WARNING
IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough=5
else
+IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough
+endif
+else
IMPLICIT_FALLTHROUGH_WARNING=
endif