[patch] Initialize a couple variables in fixincl.c

Bruce Korb bkorb@veritas.com
Sun Jan 25 00:36:00 GMT 2004


James Morrison wrote:
> 
>  Hi,
> 
>   I noticed that fixincl.c had a couple warnings for unitialized variables.
> This patch fixes those.
> 
>  Tested with make check in the fixinc directory.  Ok?

No.  Instead, set the "res" to "SKIP_FIX" in the default case
(which never happens).  As for the "pz_cmd_save", it is a weakness
in the usage analysis, though I also can't imagine teaching the
compiler to figure it out.  Maybe just NULL it out a few lines
later where pz_cmd is NULL-ed:

  if ((p_fixd->fd_flags & FD_SHELL_SCRIPT) == 0)
    {
      pz_cmd_save = NULL;
      pz_cmd = NULL;
    }
  else

I think I didn't do it 'cuz of the ugly cast.
Maybe a separate statement + curly braces and such....



More information about the Gcc-patches mailing list