diff options
author | Igor Ryzhov <iryzhov@nfware.com> | 2023-10-10 23:15:32 +0200 |
---|---|---|
committer | Igor Ryzhov <iryzhov@nfware.com> | 2023-10-12 20:23:18 +0200 |
commit | 7d67b9ff28d09de58c632f80ef7d330e45e698f6 (patch) | |
tree | 16c8afc9dc80d70951f83d2f1182ace0edc7ee49 /lib/compiler.h | |
parent | Merge pull request #14559 from opensourcerouting/feature/update_dev_versions_... (diff) | |
download | frr-7d67b9ff28d09de58c632f80ef7d330e45e698f6.tar.xz frr-7d67b9ff28d09de58c632f80ef7d330e45e698f6.zip |
build: add -Wimplicit-fallthrough
Also:
- replace all /* fallthrough */ comments with portable fallthrough;
pseudo keyword to accomodate both gcc and clang
- add missing break; statements as required by older versions of gcc
- cleanup some code to remove unnecessary fallthrough
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/compiler.h')
-rw-r--r-- | lib/compiler.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/compiler.h b/lib/compiler.h index ce6727685..0a54c02d2 100644 --- a/lib/compiler.h +++ b/lib/compiler.h @@ -33,7 +33,7 @@ extern "C" { # define _RET_NONNULL , returns_nonnull #endif #if __has_attribute(fallthrough) -# define _FALLTHROUGH __attribute__((fallthrough)); +# define fallthrough __attribute__((fallthrough)); #endif # define _CONSTRUCTOR(x) constructor(x) # define _DEPRECATED(x) deprecated(x) @@ -57,7 +57,7 @@ extern "C" { # define __has_attribute(x) 0 #endif #if __GNUC__ >= 7 -# define _FALLTHROUGH __attribute__((fallthrough)); +# define fallthrough __attribute__((fallthrough)); #endif #endif @@ -112,8 +112,8 @@ extern "C" { #ifndef _ALLOC_SIZE # define _ALLOC_SIZE(x) #endif -#ifndef _FALLTHROUGH -#define _FALLTHROUGH +#ifndef fallthrough +#define fallthrough #endif #ifndef _DEPRECATED #define _DEPRECATED(x) deprecated |