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 /zebra/rtadv.c | |
| parent | 15c05f1edf079bc03b277e44426a8af8616bb10b (diff) | |
*: 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 'zebra/rtadv.c')
| -rw-r--r-- | zebra/rtadv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zebra/rtadv.c b/zebra/rtadv.c index c3add16c56..8a7a15e46d 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -54,7 +54,7 @@ extern struct zebra_privs_t zserv_privs; #include "zebra/rtadv_clippy.c" #endif -DEFINE_MTYPE_STATIC(ZEBRA, RTADV_PREFIX, "Router Advertisement Prefix") +DEFINE_MTYPE_STATIC(ZEBRA, RTADV_PREFIX, "Router Advertisement Prefix"); #ifdef OPEN_BSD #include <netinet/icmp6.h> @@ -71,8 +71,8 @@ DEFINE_MTYPE_STATIC(ZEBRA, RTADV_PREFIX, "Router Advertisement Prefix") #define ALLNODE "ff02::1" #define ALLROUTER "ff02::2" -DEFINE_MTYPE_STATIC(ZEBRA, RTADV_RDNSS, "Router Advertisement RDNSS") -DEFINE_MTYPE_STATIC(ZEBRA, RTADV_DNSSL, "Router Advertisement DNSSL") +DEFINE_MTYPE_STATIC(ZEBRA, RTADV_RDNSS, "Router Advertisement RDNSS"); +DEFINE_MTYPE_STATIC(ZEBRA, RTADV_DNSSL, "Router Advertisement DNSSL"); /* Order is intentional. Matches RFC4191. This array is also used for command matching, so only modify with care. */ |
