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 /ripngd | |
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 'ripngd')
-rw-r--r-- | ripngd/ripng_interface.c | 2 | ||||
-rw-r--r-- | ripngd/ripng_nexthop.c | 2 | ||||
-rw-r--r-- | ripngd/ripng_offset.c | 2 | ||||
-rw-r--r-- | ripngd/ripng_peer.c | 2 | ||||
-rw-r--r-- | ripngd/ripng_route.c | 2 | ||||
-rw-r--r-- | ripngd/ripngd.c | 8 | ||||
-rw-r--r-- | ripngd/ripngd.h | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index 115d7a6b9..11a8fdff8 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -49,7 +49,7 @@ #define IPV6_LEAVE_GROUP IPV6_DROP_MEMBERSHIP #endif -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_IF, "ripng interface") +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_IF, "ripng interface"); /* Static utility function. */ static void ripng_enable_apply(struct interface *); diff --git a/ripngd/ripng_nexthop.c b/ripngd/ripng_nexthop.c index ba6e52fdd..3e9fa9093 100644 --- a/ripngd/ripng_nexthop.c +++ b/ripngd/ripng_nexthop.c @@ -39,7 +39,7 @@ #include "ripngd/ripng_debug.h" #include "ripngd/ripng_nexthop.h" -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_RTE_DATA, "RIPng rte data") +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_RTE_DATA, "RIPng rte data"); #define DEBUG 1 diff --git a/ripngd/ripng_offset.c b/ripngd/ripng_offset.c index 0094c993a..efce8a092 100644 --- a/ripngd/ripng_offset.c +++ b/ripngd/ripng_offset.c @@ -33,7 +33,7 @@ #include "ripngd/ripngd.h" -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_OFFSET_LIST, "RIPng offset lst") +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_OFFSET_LIST, "RIPng offset lst"); #define OFFSET_LIST_IN_NAME(O) ((O)->direct[RIPNG_OFFSET_LIST_IN].alist_name) #define OFFSET_LIST_IN_METRIC(O) ((O)->direct[RIPNG_OFFSET_LIST_IN].metric) diff --git a/ripngd/ripng_peer.c b/ripngd/ripng_peer.c index 0ac489c67..479fcaeb5 100644 --- a/ripngd/ripng_peer.c +++ b/ripngd/ripng_peer.c @@ -34,7 +34,7 @@ #include "ripngd/ripngd.h" #include "ripngd/ripng_nexthop.h" -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_PEER, "RIPng peer") +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_PEER, "RIPng peer"); static struct ripng_peer *ripng_peer_new(void) { diff --git a/ripngd/ripng_route.c b/ripngd/ripng_route.c index ed9d77a37..1eb1d0f31 100644 --- a/ripngd/ripng_route.c +++ b/ripngd/ripng_route.c @@ -30,7 +30,7 @@ #include "ripngd/ripngd.h" #include "ripngd/ripng_route.h" -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_AGGREGATE, "RIPng aggregate") +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_AGGREGATE, "RIPng aggregate"); static struct ripng_aggregate *ripng_aggregate_new(void) { diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index 37e23046e..749feaca6 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -44,10 +44,10 @@ #include "ripngd/ripng_debug.h" #include "ripngd/ripng_nexthop.h" -DEFINE_MGROUP(RIPNGD, "ripngd") -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG, "RIPng structure") -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_VRF_NAME, "RIPng VRF name") -DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_ROUTE, "RIPng route info") +DEFINE_MGROUP(RIPNGD, "ripngd"); +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG, "RIPng structure"); +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_VRF_NAME, "RIPng VRF name"); +DEFINE_MTYPE_STATIC(RIPNGD, RIPNG_ROUTE, "RIPng route info"); enum { ripng_all_route, ripng_changed_route, diff --git a/ripngd/ripngd.h b/ripngd/ripngd.h index 14ac29b3f..12e5a6d4a 100644 --- a/ripngd/ripngd.h +++ b/ripngd/ripngd.h @@ -86,7 +86,7 @@ #define RIPNG_INSTANCE "/frr-ripngd:ripngd/instance" #define RIPNG_IFACE "/frr-interface:lib/interface/frr-ripngd:ripng" -DECLARE_MGROUP(RIPNGD) +DECLARE_MGROUP(RIPNGD); /* RIPng structure. */ struct ripng { |