
31 Aug
2009
31 Aug
'09
4:49 p.m.
2009/8/31 Simonson, Lucanus J <lucanus.j.simonson@intel.com>:
Phil Endecott wrote:
my 10 lines of code produce 105 warnings that come to 54k of output. This is with g++ 4.1.2.
with msvc-9 I get a lot of warnings from expressions like bool bit2 = atr_ & 4; or bool bit2 = (bool)(atr_ & 4); e.g. boost\polygon\transform.hpp(256) : warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) A big amount of these can be silenced by the simple replacement bool bit2 = (atr_ & 4) != 0; here is a regular expr for that. \= *{[a-zA-Z][->.a-zA-Z_0-9]*} *{[&]} *{[1-9][0-9]*} *; = (\1 \2 \3) != 0; \= *\(bool\)({[a-zA-Z][->.a-zA-Z_0-9]*} *{[&]} *{[1-9][0-9]*} *); = (\1 \2 \3) != 0; HTH Joachim