Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: A few compiler warnings



Wayne Davison wrote:

> The following patch silences a few compiler warnings.

I'm terribly sorry -- compiling with optimisation is so slow that I
normally don't do it (only once in a while and before releases) and
without optimisations gcc doesn't report things like these.

> The first hunk sets "n" to NULL in bld_parts().  This isn't required
> by the code, but gcc isn't smart enough to figure out that "n" can't
> be used uninitialized.

Yep.

> The second hunk removes 3 unused variables.

Hmhm, the improved calculation.

> The third hunk silences 3 "might be used uninitialized" warnings, but
> someone who knows the code in cd_get() should look at it and see if
> there is a better fix (such as making one of the other switch-case
> sections the "default:", or returning an error).

Yes, run->type can only ever be of one of the CRT_* values, so we could
alternatively just turn any of the other `case's into `default'.

> I haven't committed any of this yet, though the second hunk is really
> a no-brainer.  Comments?

Please go ahead and commit it.

Thanks!


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author