From fd1c5ba0cbbd31c4713d9283c4fa5c3265ad2296 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sat, 3 Feb 2007 14:10:00 -0500 Subject: Teach build to build only the toys/*.c selected in .config, and teach CFG_TOYSH_DEBUG to shut up the spurious "gcc can't tell that this is never actually used uninitialized because gcc is stupid" warnings. --- lib/bunzip.c | 4 ++-- lib/portability.h | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/bunzip.c b/lib/bunzip.c index 049dc02e..b7996983 100644 --- a/lib/bunzip.c +++ b/lib/bunzip.c @@ -111,9 +111,9 @@ static unsigned int get_bits(bunzip_data *bd, char bits_wanted) // Decompress a block of text to intermediate buffer int read_bunzip_data(bunzip_data *bd) { - struct group_data *hufGroup; + struct group_data *hufGroup GCC_BUG; unsigned origPtr; - int dbufCount, nextSym, dbufSize, groupCount, *base, *limit, + int dbufCount, nextSym, dbufSize, groupCount, *base GCC_BUG, *limit GCC_BUG, selector, i, j, k, t, runPos, symCount, symTotal, nSelectors, byteCount[256]; char uc, mtfSymbol[256], symToByte[256], *selectors; diff --git a/lib/portability.h b/lib/portability.h index 5aa4a0bf..9f3f1b78 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -25,3 +25,15 @@ #define SWAP_LE32(x) (x) #define SWAP_LE64(x) (x) #endif + +// Some versions of gcc produce spurious "may be uninitialized" warnings in +// cases where it provably can't happen. Unfortunately, although this warning +// is calculated and produced separately from the "is definitely used +// uninitialized" warnings, there's no way to turn off the broken spurious "may +// be" warnings without also turning off the non-broken "is" warnings. + +#if CFG_TOYBOX_DEBUG +#define GCC_BUG =0 +#else +#define GCC_BUG +#endif -- cgit v1.2.3