bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

IF_LINT is dangerous (Was: Re: Version 2.5_rc1 gcc issues)


From: Joel E. Denny
Subject: IF_LINT is dangerous (Was: Re: Version 2.5_rc1 gcc issues)
Date: Sun, 1 May 2011 23:45:01 -0400 (EDT)
User-agent: Alpine 2.00 (DEB 1167 2008-08-23)

Hi Tys,

On Mon, 2 May 2011, Tys Lefering wrote:

> test compiling the version 2.5_rc1 on susebuild few small gcc issues:

Thanks for the report.

> scan-gram.l:123:7: warning: 'braces_level' may be used uninitialized
> in this function

> scan-gram.l:126:7: warning: 'context_state' may be used uninitialized
> in this function

> scan-skel.l:61:7: warning: 'out_lineno' may be used uninitialized in
> this function

In each case, the initializer is enclosed in IF_LINT, which suppresses the 
initialization when not configuring with --enable-gcc-warnings.

First, I don't understand the benefit of suppressing initializations.  If 
the point is to document that the initialization isn't intended to be 
important to the logic of the program, then a comment saying so is 
sufficient.

Second, and more importantly, because it's recommended practice for 
maintainers to always configure with --enable-gcc-warnings, we are 
actually developing using a Bison that, in the IF_LINT cases, compiles 
with possibly less warnings and that runs with different and possibly 
safer logic than the Bison the user compiles and runs.  That surely wasn't 
the intention of IF_LINT.

If there are no objections, I will soon replace all uses of IF_LINT with 
the code it encloses.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]