diff options
author | Denis Ovsienko <denis@ovsienko.info> | 2017-07-21 22:04:15 +0100 |
---|---|---|
committer | Denis Ovsienko <denis@ovsienko.info> | 2017-07-22 19:33:49 +0100 |
commit | 6df678ca315946ed6190bc8fe0a80f3c36d246c4 (patch) | |
tree | bf24ecf12b3f7a8c9255f229ba956ccc0554f854 /config.h.in | |
parent | 11fcafcf6928d793411ae3dba9af324e3d027bb2 (diff) | |
download | tcpdump-6df678ca315946ed6190bc8fe0a80f3c36d246c4.tar.gz |
Check for __attribute__ ((fallthrough)) (GCC 7).
The documentation claims that recent GCC is now better by default at
spotting cases of code flow falling through (which is true) and that it
avoids false positives by matching nearby source code comments with
regexps. However, the latter feature doesn't seem to work as reliably
as the manual describes it, so let's have a macro for this purpose.
Tested to work on:
* x86_64, Fedora 26, GCC 7.1.1 (w/__attribute__, w/fallthrough)
* x86_64, Ubuntu 16.04, GCC 5.4.0 (w/__attribute__, w/o fallthrough)
* x86_64, FreeBSD 11.0, CLang 3.8.0 (w/__attribute__, w/o fallthrough)
* SPARC, Solaris 10, SolStudio 12.4 (w/__attribute__, w/o fallthrough)
* SPARC, Solaris 10, SunStudio 11 (w/o __attribute__)
Diffstat (limited to 'config.h.in')
-rw-r--r-- | config.h.in | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/config.h.in b/config.h.in index bbe1811b..6388afdc 100644 --- a/config.h.in +++ b/config.h.in @@ -331,6 +331,10 @@ #define below would cause a syntax error. */ #undef _UINT8_T +/* define if your compiler allows __attribute__((fallthrough)) without a + warning */ +#undef __ATTRIBUTE___FALLTHROUGH_OK + /* define if your compiler allows __attribute__((format)) without a warning */ #undef __ATTRIBUTE___FORMAT_OK |