You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Roy T. Fielding" <fi...@kiwi.ICS.UCI.EDU> on 1997/01/30 07:16:49 UTC

[PATCH] silence regex warnings

>   * warnings in regex
>        Status: Roy would like to see this fixed since it makes Apache
>                a mess on Solaris when using -Wall.  Roy will make patch.

I spent a couple hours trying to fix the warnings directly, but the vast
majority are created by side-effect macros that can't be fixed without
risking total disaster.  Since none of the warnings are significant,
I've given up and recommend the following patch instead.  It would probably
be better to define a special -DREGEX_CFLAGS in Configuration, but this
works for me.  It won't work for compilers that need something defined
in EXTRA_CFLAGS, so a more portable solution would be welcome from those
who regularly mess with the Configure stuff.  OTOH, this method prevents
Apache-specific defines from interfering with regex defines.

.....Roy

Index: Makefile.tmpl
===================================================================
RCS file: /export/home/cvs/apache/src/Makefile.tmpl,v
retrieving revision 1.40
diff -c -r1.40 Makefile.tmpl
*** Makefile.tmpl	1997/01/26 01:59:03	1.40
--- Makefile.tmpl	1997/01/30 06:08:29
***************
*** 29,35 ****
  	$(CC) $(LFLAGS)  -o httpd $(OBJS) $(REGLIB) $(LIBS)
  
  regex/libregex.a:
! 	(cd regex; $(MAKE) lib CC=$(CC) AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)')
  
  modules/proxy/libproxy.a:
  	(cd modules; \
--- 29,35 ----
  	$(CC) $(LFLAGS)  -o httpd $(OBJS) $(REGLIB) $(LIBS)
  
  regex/libregex.a:
! 	(cd regex; $(MAKE) lib CC=$(CC) AUX_CFLAGS='$(OPTIM)' RANLIB='$(RANLIB)')
  
  modules/proxy/libproxy.a:
  	(cd modules; \

Re: [PATCH] silence regex warnings

Posted by Brian Behlendorf <br...@organic.com>.
On Wed, 29 Jan 1997, Roy T. Fielding wrote:
> >   * warnings in regex
> >        Status: Roy would like to see this fixed since it makes Apache
> >                a mess on Solaris when using -Wall.  Roy will make patch.
> 
> I spent a couple hours trying to fix the warnings directly, but the vast
> majority are created by side-effect macros that can't be fixed without
> risking total disaster.  Since none of the warnings are significant,
> I've given up and recommend the following patch instead.  It would probably
> be better to define a special -DREGEX_CFLAGS in Configuration, but this
> works for me.  It won't work for compilers that need something defined
> in EXTRA_CFLAGS, so a more portable solution would be welcome from those
> who regularly mess with the Configure stuff.  OTOH, this method prevents
> Apache-specific defines from interfering with regex defines.

I've often wondered why it was propagated - it did cause some annoyance on SGI
6.2 for me, once.  This is fine with me.

	Brian

--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--
brian@organic.com  www.apache.org  hyperreal.com  http://www.organic.com/JOBS


Re: [PATCH] silence regex warnings

Posted by Marc Slemko <ma...@znep.com>.
On Wed, 29 Jan 1997, Roy T. Fielding wrote:

> >   * warnings in regex
> >        Status: Roy would like to see this fixed since it makes Apache
> >                a mess on Solaris when using -Wall.  Roy will make patch.
> 
> I spent a couple hours trying to fix the warnings directly, but the vast
> majority are created by side-effect macros that can't be fixed without
> risking total disaster.  Since none of the warnings are significant,
> I've given up and recommend the following patch instead.  It would probably

Mmm?  What's against trying to cast them to void?

There are a couple of others that should be fixed I think; don't hurt
anything right now, but who knows...  ones like using 'register const...'
instead of 'const register...'.  First good, second bad.

Most of the warnings can be eliminated by:

Index: regcomp.c
===================================================================
RCS file: /export/home/cvs/apache/src/regex/regcomp.c,v
retrieving revision 1.2
diff -u -r1.2 regcomp.c
--- regcomp.c   1997/01/25 22:38:29     1.2
+++ regcomp.c   1997/01/30 06:37:35
@@ -51,7 +51,7 @@
 #define        NEXTn(n)        (p->next += (n))
 #define        GETNEXT()       (*p->next++)
 #define        SETERROR(e)     seterr(p, (e))
-#define        REQUIRE(co, e)  ((co) || SETERROR(e))
+#define        REQUIRE(co, e)  ((void)((co) || SETERROR(e)))
 #define        MUSTSEE(c, e)   (REQUIRE(MORE() && PEEK() == (c), e))
 #define        MUSTEAT(c, e)   (REQUIRE(MORE() && GETNEXT() == (c), e))
 #define        MUSTNOTSEE(c, e)        (REQUIRE(!MORE() || PEEK() != (c), e))

I don't see why compilers shouldn't like that, but some may not...





> be better to define a special -DREGEX_CFLAGS in Configuration, but this
> works for me.  It won't work for compilers that need something defined
> in EXTRA_CFLAGS, so a more portable solution would be welcome from those
> who regularly mess with the Configure stuff.  OTOH, this method prevents
> Apache-specific defines from interfering with regex defines.


> 
> .....Roy
> 
> Index: Makefile.tmpl
> ===================================================================
> RCS file: /export/home/cvs/apache/src/Makefile.tmpl,v
> retrieving revision 1.40
> diff -c -r1.40 Makefile.tmpl
> *** Makefile.tmpl	1997/01/26 01:59:03	1.40
> --- Makefile.tmpl	1997/01/30 06:08:29
> ***************
> *** 29,35 ****
>   	$(CC) $(LFLAGS)  -o httpd $(OBJS) $(REGLIB) $(LIBS)
>   
>   regex/libregex.a:
> ! 	(cd regex; $(MAKE) lib CC=$(CC) AUX_CFLAGS='$(CFLAGS)' RANLIB='$(RANLIB)')
>   
>   modules/proxy/libproxy.a:
>   	(cd modules; \
> --- 29,35 ----
>   	$(CC) $(LFLAGS)  -o httpd $(OBJS) $(REGLIB) $(LIBS)
>   
>   regex/libregex.a:
> ! 	(cd regex; $(MAKE) lib CC=$(CC) AUX_CFLAGS='$(OPTIM)' RANLIB='$(RANLIB)')
>   
>   modules/proxy/libproxy.a:
>   	(cd modules; \
>