From ab3964db4e75e34f6f9347406c5fd2bced04f2dd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 13 Oct 2015 14:50:20 +0200 Subject: libbb: introduce kernel-style BUILD_BUG_ON() Signed-off-by: Denys Vlasenko --- networking/tc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'networking/tc.c') diff --git a/networking/tc.c b/networking/tc.c index 76e2e8359..6d1fef993 100644 --- a/networking/tc.c +++ b/networking/tc.c @@ -64,15 +64,14 @@ struct globals { uint32_t filter_proto; } FIX_ALIASING; #define G (*(struct globals*)&bb_common_bufsiz1) -struct BUG_G_too_big { - char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; -}; #define filter_ifindex (G.filter_ifindex) #define filter_qdisc (G.filter_qdisc) #define filter_parent (G.filter_parent) #define filter_prio (G.filter_prio) #define filter_proto (G.filter_proto) -#define INIT_G() do { } while (0) +#define INIT_G() do { \ + BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ +} while (0) /* Allocates a buffer containing the name of a class id. * The caller must free the returned memory. */ -- cgit v1.2.3