diff options
Diffstat (limited to 'procps/top.c')
-rw-r--r-- | procps/top.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/procps/top.c b/procps/top.c index 3d67c3cfd..9a3f171ac 100644 --- a/procps/top.c +++ b/procps/top.c @@ -184,10 +184,6 @@ struct globals { }; //FIX_ALIASING; - large code growth enum { LINE_BUF_SIZE = COMMON_BUFSIZE - offsetof(struct globals, line_buf) }; #define G (*(struct globals*)&bb_common_bufsiz1) -struct BUG_bad_size { - char BUG_G_too_big[sizeof(G) <= COMMON_BUFSIZE ? 1 : -1]; - char BUG_line_buf_too_small[LINE_BUF_SIZE > 80 ? 1 : -1]; -}; #define top (G.top ) #define ntop (G.ntop ) #define sort_field (G.sort_field ) @@ -204,7 +200,10 @@ struct BUG_bad_size { #define num_cpus (G.num_cpus ) #define total_pcpu (G.total_pcpu ) #define line_buf (G.line_buf ) -#define INIT_G() do { } while (0) +#define INIT_G() do { \ + BUILD_BUG_ON(sizeof(G) > COMMON_BUFSIZE); \ + BUILD_BUG_ON(LINE_BUF_SIZE <= 80); \ +} while (0) enum { OPT_d = (1 << 0), |