Re:C++ at Google: Here Be Dragons
by lurker19 on Monday May 23, 2011 @11:37PM
(#2578555)
When is assigning a pointer to be boolean false intentional and correct?
[ Parent
| on HN ]
Most of the cases we ran into were metaprogramming techniques which test whether an expression is a valid null pointer constants. These got innocently applied to 'false' and trigger the warning needlessly.
Re:C++ at Google: Here Be Dragons
by koenigdavidmj on Tuesday May 24, 2011 @05:41PM
(#2581778)
Done that before...had a variable that was formerly an int:
int foo = 0;
But got changed into a non-integral type: Thing foo = 0;
Turns out Thing had a copy constructor roughly like: Thing::Thing(Thing* old)
: field(old->field)
{
}
Needless to say, my program was not very happy.