You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Greg Stein <gs...@lyra.org> on 2001/05/01 20:53:39 UTC

Re: cvs commit: httpd-2.0/modules/dav/main util.c

Hrm. I've got "maintainer mode" set on my Apache config, but didn't see that
warning from GCC. What warning switches do you use, and could we get some of
them set for maintainer mode also? I'm all up for stricter GCC warnings.

Cheers,
-g

On Tue, May 01, 2001 at 11:17:08AM -0000, trawick@apache.org wrote:
> trawick     01/05/01 04:17:08
> 
>   Modified:    modules/dav/main util.c
>   Log:
>   Initialize a local variable to prevent a gcc warning about
>   possible use before set.  The code was fine but it is best
>   to keep gcc quiet lest we stop paying attention.
>   
>   Revision  Changes    Path
>   1.30      +1 -1      httpd-2.0/modules/dav/main/util.c
>   
>   Index: util.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/modules/dav/main/util.c,v
>   retrieving revision 1.29
>   retrieving revision 1.30
>   diff -u -r1.29 -r1.30
>   --- util.c	2001/04/27 05:27:00	1.29
>   +++ util.c	2001/05/01 11:17:07	1.30
>   @@ -334,7 +334,7 @@
>        char *cdata;
>        char *s;
>        apr_size_t tlen;
>   -    const char *found_text;
>   +    const char *found_text = NULL; /* initialize to avoid gcc warning */
>        int found_count = 0;
>    
>        for (scan = elem->first_cdata.first; scan != NULL; scan = scan->next) {
>   
>   
>   

-- 
Greg Stein, http://www.lyra.org/

Re: cvs commit: httpd-2.0/modules/dav/main util.c

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Has anyone else noticed that replies are including more
and mooooorree of the complete quoted message thread,
rather than just a small relevant quoted bit?  I mean,
over 50 lines of quotation, involving two previous replies,
seems just a bit excessive for a 4-line response.. :-)
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: cvs commit: httpd-2.0/modules/dav/main util.c

Posted by Ben Laurie <be...@algroup.co.uk>.
Greg Stein wrote:
> 
> On Tue, May 01, 2001 at 03:07:15PM -0400, Jeff Trawick wrote:
> > Greg Stein <gs...@lyra.org> writes:
> > > Hrm. I've got "maintainer mode" set on my Apache config, but didn't see that
> > > warning from GCC. What warning switches do you use, and could we get some of
> > > them set for maintainer mode also? I'm all up for stricter GCC warnings.
> >...
> > nothing special...
> >
> > --enable-maintainer-mode
> >
> > here is what it the compile and warning looked like on AIX+gcc:
> >
> > /bin/sh /home/trawick/gcc_regress/httpd-2.0/libtool --silent
> > --mode=compile gcc   -D_USE_IRS -U__STR__ -D_THREAD_SAFE   -g -O2
> > -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
> > -mthreads -DAP_DEBUG -DNO_DBM_REWRITEMAP
> > -I. -I/home/trawick/gcc_regress/httpd-2.0/os/unix
> > -I/home/trawick/gcc_regress/httpd-2.0/server/mpm/threaded
> > -I/home/trawick/gcc_regress/httpd-2.0/modules/http
> > -I/home/trawick/gcc_regress/httpd-2.0/include
> > -I/home/trawick/gcc_regress/httpd-2.0/srclib/apr/include
> > -I/home/trawick/gcc_regress/httpd-2.0/srclib/apr-util/include
> > -I/home/trawick/gcc_regress/httpd-2.0/modules/dav/main -c util.c &&
> > touch util.lo
> > util.c: In function `dav_xml_get_cdata':
> > util.c:337: warning: `found_text' might be used uninitialized in this function
> >
> > You didn't get bit by the change from --with-maintainer-mode to
> > --enable-maintainer-mode, did you?
> 
> Nope... I was the one that applied that patch :-)
> 
> I've got egcs-2.91.66 on a Redhat 6.x box. I just looked at the command
> line, and it appears to be the same:
> 
> [gstein@kurgan main]$ make util.lo
> /bin/sh /home/gstein/src/httpd-2.0/libtool --silent --mode=compile gcc  -I.
> -I/home/gstein/src/httpd-2.0/modules/dav/main
> -I/home/gstein/src/httpd-2.0/server/mpm/prefork
> -I/home/gstein/src/httpd-2.0/modules/http
> -I/home/gstein/src/httpd-2.0/include
> -I/home/gstein/src/httpd-2.0/srclib/apr/include
> -I/home/gstein/src/httpd-2.0/srclib/apr-util/include
> -I/home/gstein/src/httpd-2.0/modules/dav/main
> -I/home/gstein/src/httpd-2.0/os/unix   -DLINUX=2 -D_REENTRANT -D_REENTRANT
> -pthread -g -Wall -Wmissing-prototypes -Wstrict-prototypes
> -Wmissing-declarations -DAP_DEBUG  -c util.c && touch util.lo
> [gstein@kurgan main]$
> 
> Must be something in the gcc version, I'd think.

Yeah, different versions vary in sensitivity. BTW, some warnings don't
happen unless optimisation is on, so we may want an
optimised-maintainer-mode (best not to do it by default coz its
confusing when using gdb).

Cheers,

Ben.

--
http://www.apache-ssl.org/ben.html

"There is no limit to what a man can do or how far he can go if he
doesn't mind who gets the credit." - Robert Woodruff

Re: cvs commit: httpd-2.0/modules/dav/main util.c

Posted by Greg Stein <gs...@lyra.org>.
On Tue, May 01, 2001 at 03:07:15PM -0400, Jeff Trawick wrote:
> Greg Stein <gs...@lyra.org> writes:
> > Hrm. I've got "maintainer mode" set on my Apache config, but didn't see that
> > warning from GCC. What warning switches do you use, and could we get some of
> > them set for maintainer mode also? I'm all up for stricter GCC warnings.
>...
> nothing special...
> 
> --enable-maintainer-mode
> 
> here is what it the compile and warning looked like on AIX+gcc:
> 
> /bin/sh /home/trawick/gcc_regress/httpd-2.0/libtool --silent
> --mode=compile gcc   -D_USE_IRS -U__STR__ -D_THREAD_SAFE   -g -O2
> -Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
> -mthreads -DAP_DEBUG -DNO_DBM_REWRITEMAP
> -I. -I/home/trawick/gcc_regress/httpd-2.0/os/unix
> -I/home/trawick/gcc_regress/httpd-2.0/server/mpm/threaded
> -I/home/trawick/gcc_regress/httpd-2.0/modules/http
> -I/home/trawick/gcc_regress/httpd-2.0/include
> -I/home/trawick/gcc_regress/httpd-2.0/srclib/apr/include
> -I/home/trawick/gcc_regress/httpd-2.0/srclib/apr-util/include
> -I/home/trawick/gcc_regress/httpd-2.0/modules/dav/main -c util.c &&
> touch util.lo
> util.c: In function `dav_xml_get_cdata':
> util.c:337: warning: `found_text' might be used uninitialized in this function
> 
> You didn't get bit by the change from --with-maintainer-mode to
> --enable-maintainer-mode, did you?

Nope... I was the one that applied that patch :-)

I've got egcs-2.91.66 on a Redhat 6.x box. I just looked at the command
line, and it appears to be the same:

[gstein@kurgan main]$ make util.lo
/bin/sh /home/gstein/src/httpd-2.0/libtool --silent --mode=compile gcc  -I.
-I/home/gstein/src/httpd-2.0/modules/dav/main
-I/home/gstein/src/httpd-2.0/server/mpm/prefork
-I/home/gstein/src/httpd-2.0/modules/http
-I/home/gstein/src/httpd-2.0/include
-I/home/gstein/src/httpd-2.0/srclib/apr/include
-I/home/gstein/src/httpd-2.0/srclib/apr-util/include
-I/home/gstein/src/httpd-2.0/modules/dav/main
-I/home/gstein/src/httpd-2.0/os/unix   -DLINUX=2 -D_REENTRANT -D_REENTRANT
-pthread -g -Wall -Wmissing-prototypes -Wstrict-prototypes
-Wmissing-declarations -DAP_DEBUG  -c util.c && touch util.lo
[gstein@kurgan main]$

Must be something in the gcc version, I'd think.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: cvs commit: httpd-2.0/modules/dav/main util.c

Posted by Jeff Trawick <tr...@bellsouth.net>.
Greg Stein <gs...@lyra.org> writes:

> Hrm. I've got "maintainer mode" set on my Apache config, but didn't see that
> warning from GCC. What warning switches do you use, and could we get some of
> them set for maintainer mode also? I'm all up for stricter GCC warnings.

> >   Modified:    modules/dav/main util.c
> >   Log:

> >   Index: util.c
> >   @@ -334,7 +334,7 @@
> >        char *cdata;
> >        char *s;
> >        apr_size_t tlen;
> >   -    const char *found_text;
> >   +    const char *found_text = NULL; /* initialize to avoid gcc warning */

nothing special...

--enable-maintainer-mode

here is what it the compile and warning looked like on AIX+gcc:

/bin/sh /home/trawick/gcc_regress/httpd-2.0/libtool --silent
--mode=compile gcc   -D_USE_IRS -U__STR__ -D_THREAD_SAFE   -g -O2
-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
-mthreads -DAP_DEBUG -DNO_DBM_REWRITEMAP
-I. -I/home/trawick/gcc_regress/httpd-2.0/os/unix
-I/home/trawick/gcc_regress/httpd-2.0/server/mpm/threaded
-I/home/trawick/gcc_regress/httpd-2.0/modules/http
-I/home/trawick/gcc_regress/httpd-2.0/include
-I/home/trawick/gcc_regress/httpd-2.0/srclib/apr/include
-I/home/trawick/gcc_regress/httpd-2.0/srclib/apr-util/include
-I/home/trawick/gcc_regress/httpd-2.0/modules/dav/main -c util.c &&
touch util.lo
util.c: In function `dav_xml_get_cdata':
util.c:337: warning: `found_text' might be used uninitialized in this function

You didn't get bit by the change from --with-maintainer-mode to
--enable-maintainer-mode, did you?

-- 
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
       http://www.geocities.com/SiliconValley/Park/9289/
             Born in Roswell... married an alien...