On 05/01/11 20:45, Joel E. Denny wrote:
> 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.
It depends on how important efficiency is. If it's not important,
a comment should suffice. If it is, then leaving the initialization
in causes compilers to generate worse code.
> 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
Although that is a problem, in practice it's minor.
> If there are no objections, I will soon replace all uses of IF_LINT with
> the code it encloses.
Please leave the gnulib IF_LINTs alone; they're used in programs
where efficiency is considered important. For Bison code where efficiency
doesn't matter that much, you might consider putting something
like this into system.h:
/* Use this when the actual value X doesn't matter, but something
needs to be present to pacify compilers that would otherwise warn
about possibly-uninitialized variables. */
#define DONT_CARE(x) (x)
and then initializers that exist merely to pacify GCC can be
written like this:
location id_loc = DONT_CARE (empty_location);
That way, you won't need a special comment next to every such
initializer.