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/ftpgetput.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'networking/ftpgetput.c') diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 8283366cc..b398bc874 100644 --- a/networking/ftpgetput.c +++ b/networking/ftpgetput.c @@ -62,9 +62,6 @@ struct globals { } FIX_ALIASING; #define G (*(struct globals*)&bb_common_bufsiz1) enum { BUFSZ = COMMON_BUFSIZE - offsetof(struct globals, buf) }; -struct BUG_G_too_big { - char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; -}; #define user (G.user ) #define password (G.password ) #define lsa (G.lsa ) @@ -72,7 +69,9 @@ struct BUG_G_too_big { #define verbose_flag (G.verbose_flag ) #define do_continue (G.do_continue ) #define buf (G.buf ) -#define INIT_G() do { } while (0) +#define INIT_G() do { \ + BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ +} while (0) static void ftp_die(const char *msg) NORETURN; -- cgit v1.2.3