diff options
author | Joshua Watt <jpewhacker@gmail.com> | 2018-02-09 10:27:18 -0600 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2018-02-10 03:19:26 +0100 |
commit | 555e15ebe8bf1eb33d00747173cfc80cc65648a4 (patch) | |
tree | 6aa9cca6e04514cbc45d88f96a873cc6a4767472 /config | |
parent | 240a068fcf3eb6bbcda525f80c8778de62621d9e (diff) |
Use fallthrough attribute.
Use __attribute__ ((fallthrough)) to indicate switch case fall through
instead of a comment. This ensures that the fallthrough warning is not
triggered even if the file is pre-processed (hence stripping the
comments) before it is compiled.
The actual fallback implementation is hidden behind a FALLBACK macro in
case the compiler doesn't support it.
Finally, the -Wimplict-fallthrough warning was upgraded to only allow
the attribute to satisfy it; a comment alone is no longer sufficient.
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Diffstat (limited to 'config')
-rw-r--r-- | config/ChangeLog | 4 | ||||
-rw-r--r-- | config/eu.am | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/config/ChangeLog b/config/ChangeLog index ae40cc07..681def2f 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2018-02-09 Joshua Watt <JPEWhacker@gmail.com> + + * eu.am (IMPLICIT_FALLTHROUGH_WARNING): Set to 5. + 2017-11-02 Mark Wielaard <mark@klomp.org> * elfutils.spec.in: Config files under /usr/lib/sysctl.d (_sysctldir) diff --git a/config/eu.am b/config/eu.am index 05c27f02..c2cc349c 100644 --- a/config/eu.am +++ b/config/eu.am @@ -62,7 +62,9 @@ NULL_DEREFERENCE_WARNING= endif if HAVE_IMPLICIT_FALLTHROUGH_WARNING -IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough +# Use strict fallthrough. Only __attribute__((fallthrough)) will prevent the +# warning +IMPLICIT_FALLTHROUGH_WARNING=-Wimplicit-fallthrough=5 else IMPLICIT_FALLTHROUGH_WARNING= endif |