This is the mail archive of the gcc@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: RFC: -Wall by default


On 2012-04-05 16:44:28 -0400, Robert Dewar wrote:
> On 4/5/2012 4:24 PM, Russ Allbery wrote:
> >Personally, as a matter of *style*, I eliminate such cases either by
> >initializing the variable or restructuring the function.  But this is very
> >much a question of style, not of correctness.
> 
> Indeed, and for me, when you are forced to do an initialization like
> this, it is mandatory to comment why you are initializing it, otherwise
> it obscures the code ("why is this being initialized, where is that
> value used?") and that ends up junky IMO. The Ada front end unfortunately
> has quite a few such commented junk initializations.

And moreover, perhaps in such a case, other compilers and/or future
GCC versions would give a warning because a value is set but not used.

-- 
Vincent Lefèvre <vincent@vinc17.net> - Web: <http://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)


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