Re: MSVC sillywarnings -- more?
"Alf P. Steinbach" <alfps@start.no>
4127 // conditional expression is constant
That is not silly at all, and do catch mistakes -- though too bad it can't
guess where we used a constant intentionally...
4099 // Noah Roberts| first seen using 'struct' now seen using 'class'
Some versions create different names for class/struct so ignoring this may
lead to cryptic linker errors...
My tuning file looks like below. I normally compile at W3 switching to W4
only occasionally. So most tuning is actually to elevate levels...
- ----------
// this file rearranges the default levels of warning messages
#pragma warning(2:4032) // function arg has different type from
declaration
#pragma warning(2:4092) // 'sizeof' value too big
#pragma warning(2:4132 4268)// const object not initialized
#pragma warning(2:4152) // pointer conversion between function and data
#pragma warning(error:4239) // standard doesn't allow this conversion
#pragma warning(error:4172) // returning address of local variable or
temporary
#pragma warning(1:4701 4700) // local variable used without being
initialized
#pragma warning(2:4706) // if (a=b) instead of (if a==b)
#pragma warning(2:4709) // comma in array subscript
#pragma warning(2:4061) // not all enum values tested in switch
statement
#pragma warning(4:4710) // inline function was not inlined
#pragma warning(1:4121) // space added for structure alignment
#pragma warning(disable:4505) // unreferenced local function removed
#pragma warning(3:4019) // empty statement at global scope
#pragma warning(3:4057) // pointers refer to different base types
#pragma warning(3:4125) // decimal digit terminates octal escape
#pragma warning(2:4131) // old-style function declarator
#pragma warning(3:4211) // extern redefined as static
#pragma warning(4:4213) // cast on left side of = is non-standard
#pragma warning(1:4222) // member function at file scope shouldn't be
static
#pragma warning(error:4234 4235)// keyword not supported or reserved for
future
#pragma warning(3:4504) // type ambiguous; simplify code
#pragma warning(3:4507) // explicit linkage specified after default
linkage
#pragma warning(1:4515) // namespace uses itself
#pragma warning(3:4516 4517)// access declarations are deprecated
#pragma warning(3:4670) // base class of thrown object is inaccessible
#pragma warning(3:4671) // copy ctor of thrown object is inaccessible
#pragma warning(3:4673) // thrown object cannot be handled in catch
block
#pragma warning(3:4674) // dtor of thrown object is inaccessible
#pragma warning(error:4705) // statement has no effect (example: a+1;)
#pragma warning(disable:4786) // identifier was truncated to 'number'
characters in the debug information
#pragma warning(3:4727) // conditional expression is constant
#pragma warning(error:4508) // function should return a value; void return
type assumed
#pragma warning(3:4239) //nonstandard extension used : 'token' : conversion
from 'type' to 'type'
#pragma warning(error:4146) //unary minus operator applied to unsigned type,
result still unsigned
#pragma warning(1:4132) //'object' : const object should be initialized
#pragma warning(1:4238) //nonstandard extension used : class rvalue used as
lvalue
#pragma warning (disable:4097) //'typedef-name 'tParent' used as synonym for
class-name 'IdxArr<struct tabdef>'
#pragma warning (disable:4710) //function not expanded
#pragma warning (disable:4711) //function 'function' selected for inline
expansion
#ifdef _DEBUG
#pragma warning(4:4800) //forcing bool variable to one or zero, possible
performance loss
#else
#pragma warning(disable:4800) //forcing bool variable to one or zero,
possible performance loss
#pragma warning(disable:4100) //unreferenced formal parameter
#endif
#pragma warning(disable:4290) //C++ exception specification ignored