Possible bug in g-wrap gw-* code

Bill Gribble grib@linuxdevel.com
19 Oct 2002 14:08:24 -0500


On Sat, 2002-10-19 at 11:43, Matthew Vanecek wrote:
> Anyhow, the above type of warnings generate over 1000 lines of warnings,
> so it should be taken care of.

Getting rid of these warnings would require a significant
re-architecting of g-wrap and it's unlikely to happen anytime soon as
far as I can tell.  The warnings are spurious, as you point out.  I
agree that it would be nice for them to go away, but it would be much
easier just to turn off warnings with -Wno-uninit for compilation of the
g-wrap generated files.

The problem is that there's no generic way to initialize C variables,
and g-wrap is generating C code programmatically. Without including a
bit of C code to "default initialize" a C variable in the g-wrap file
for every wrapped C type, g-wrap can't know that a decent default
initializer is { 0, NULL, 0, NULL } for some random struct but just 0 or
NULL for some other type.

So, it would require a significant amount of work to do in any case, and
would provide exactly 0 improvement in safety of run-time code while
making more room for g-wrap wrapper generators to insert screwups that
would silently cause problems. 

BTW, rlb@cs.utexas.edu doesn't work any more.  You might try
rlb@defaultvalue.org if you want to get Rob directly. 

b.g.