This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH c++] Reduce -Weffc++ Rule 12 false positives


On Wednesday, 8. February 2006 01:04, Andrew Pinski wrote:

> Huh? the default constructor for integer types is assigning it to zero
> but then again most of the time dead store elimination can remove the
> dead store 

Exactly! It can not do that for non-POD types, since the default constructor 
might have side-effects, and eliminating those would be evil. Therfore 
implicit default constructor calls are evil and should be optimized away by 
the programmer, not by the compiler. 

> so it really does not matter in general. 

It does for non-POD types. It doesn't for POD types, thats exactly why my 
patch tries to suppress those warnings :)

Anyway, I guess I give up and keep the patch around locally. 

Dirk


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]