diff options
author | Denys Vlasenko | 2015-10-13 14:50:20 +0200 |
---|---|---|
committer | Denys Vlasenko | 2015-10-13 14:50:20 +0200 |
commit | ab3964db4e75e34f6f9347406c5fd2bced04f2dd (patch) | |
tree | 92113e4a008338ed8534858db97d3a5e09dc210b /networking/ftpgetput.c | |
parent | f7ad927c2059ef9cd1cd6befeb43f26b92f6369f (diff) | |
download | busybox-ab3964db4e75e34f6f9347406c5fd2bced04f2dd.zip busybox-ab3964db4e75e34f6f9347406c5fd2bced04f2dd.tar.gz |
libbb: introduce kernel-style BUILD_BUG_ON()
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/ftpgetput.c')
-rw-r--r-- | networking/ftpgetput.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/networking/ftpgetput.c b/networking/ftpgetput.c index 8283366..b398bc8 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; |