diff options
author | David Lamparter <equinox@diac24.net> | 2021-02-21 06:18:10 +0100 |
---|---|---|
committer | David Lamparter <equinox@diac24.net> | 2021-03-17 06:18:17 +0100 |
commit | bf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c (patch) | |
tree | cd62a7c64fe8eb9f3252e1b608f1fb939c2a772c /bgpd/bgp_pbr.c | |
parent | *: require ISO C11 (or C++11) (diff) | |
download | frr-bf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c.tar.xz frr-bf8d3d6aca3f20255a621ed1c148fd05b3a8ae5c.zip |
*: require semicolon after DEFINE_MTYPE & co
Back when I put this together in 2015, ISO C11 was still reasonably new
and we couldn't require it just yet. Without ISO C11, there is no
"good" way (only bad hacks) to require a semicolon after a macro that
ends with a function definition. And if you added one anyway, you'd get
"spurious semicolon" warnings on some compilers...
With C11, `_Static_assert()` at the end of a macro will make it so that
the semicolon is properly required, consumed, and not warned about.
Consistently requiring semicolons after "file-level" macros matches
Linux kernel coding style and helps some editors against mis-syntax'ing
these macros.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'bgpd/bgp_pbr.c')
-rw-r--r-- | bgpd/bgp_pbr.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/bgpd/bgp_pbr.c b/bgpd/bgp_pbr.c index 171522f8a..2c6c2c386 100644 --- a/bgpd/bgp_pbr.c +++ b/bgpd/bgp_pbr.c @@ -37,12 +37,12 @@ #include "bgpd/bgp_flowspec_private.h" #include "bgpd/bgp_errors.h" -DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH_ENTRY, "PBR match entry") -DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH, "PBR match") -DEFINE_MTYPE_STATIC(BGPD, PBR_ACTION, "PBR action") -DEFINE_MTYPE_STATIC(BGPD, PBR_RULE, "PBR rule") -DEFINE_MTYPE_STATIC(BGPD, PBR, "BGP PBR Context") -DEFINE_MTYPE_STATIC(BGPD, PBR_VALMASK, "BGP PBR Val Mask Value") +DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH_ENTRY, "PBR match entry"); +DEFINE_MTYPE_STATIC(BGPD, PBR_MATCH, "PBR match"); +DEFINE_MTYPE_STATIC(BGPD, PBR_ACTION, "PBR action"); +DEFINE_MTYPE_STATIC(BGPD, PBR_RULE, "PBR rule"); +DEFINE_MTYPE_STATIC(BGPD, PBR, "BGP PBR Context"); +DEFINE_MTYPE_STATIC(BGPD, PBR_VALMASK, "BGP PBR Val Mask Value"); /* chain strings too long to fit in one line */ #define FSPEC_ACTION_EXCEED_LIMIT "flowspec actions exceeds limit" |