You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Justin Erenkrantz <je...@ebuilt.com> on 2001/09/03 09:15:16 UTC

Re: new mod_include warnings

[ Cliff sent me a note that mod_include is generating warnings... ]

On Mon, Sep 03, 2001 at 12:17:38AM -0400, Cliff Woolley wrote:
> On Sun, 2 Sep 2001, Justin Erenkrantz wrote:
> 
> > On Mon, Sep 03, 2001 at 12:08:35AM -0400, Cliff Woolley wrote:
> > >
> > > mod_include.c: In function `find_start_sequence':
> > > mod_include.c:226: warning: `rv' might be used uninitialized in this
> > > function
> > > mod_include.c:245: warning: `start_index' might be used uninitialized in
> > > this function
> > > mod_include.c: In function `find_end_sequence':
> > > mod_include.c:344: warning: `rv' might be used uninitialized in this
> > > function

The warnings on 226 and 344 can just be silenced by adding = 0 to the
rv decl.  I do wonder if the !SUCCESS check should be moved inside of 
the !read_done block.  I actually don't think it should be - consider
the case of lines 237/354 returning an error condition.  It'd be
caught at line 265/373.  So, I do think adding = 0 silences the
warning, but realistically by the time we hit lines 265/373, we've
already set rv.  (My gcc doesn't emit these warnings under -Wall - 
what version are you using?)

However, the warning for 245 looks like a legitimate bug on our
part.  I'm guessing start_index should have been set to 
ctx->head_start_index, but 0 may be right too.  I'm not sure.
-- justin