This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH c++] Reduce -Weffc++ Rule 12 false positives
- From: Dirk Mueller <dmueller at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 8 Feb 2006 01:11:45 +0100
- Subject: Re: [PATCH c++] Reduce -Weffc++ Rule 12 false positives
- References: <200602080004.k180433P003505@earth.phy.uc.edu>
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