httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: svn commit: r1040177 - /httpd/httpd/trunk/modules/http/http_protocol.c
Date Fri, 03 Dec 2010 14:26:41 GMT
On Fri, Dec 03, 2010 at 09:52:06AM +0100, Guenter Knauf wrote:
> Am 02.12.2010 10:39, schrieb Joe Orton:
> >On Mon, Nov 29, 2010 at 04:37:49PM -0000, fuankg@apache.org wrote:
> >>URL: http://svn.apache.org/viewvc?rev=1040177&view=rev
> >>Log:
> >>Supress compiler warning.
> >...
> >>==============================================================================
> >>--- httpd/httpd/trunk/modules/http/http_protocol.c (original)
> >>+++ httpd/httpd/trunk/modules/http/http_protocol.c Mon Nov 29 16:37:49 2010
> >>@@ -204,7 +204,12 @@ AP_DECLARE(int) ap_set_keepalive(request
> >>       *   THEN we can be persistent, which requires more headers be output.
> >>       *
> >>       * Note that the condition evaluation order is extremely important.
> >>+     *
> >>+     * Silent compiler warnings for (r->chunked = 1) with #pragma
> >>       */
> >>+#ifdef __WATCOMC__
> >>+#pragma disable_message(105)
> >>+#endif
> >
> >Eww.  Do you really need to litter the source code with this stuff?  Can
> >you not flip compiler switches in the Makefiles?  Regards, Joe
> no. If I use a compiler switch it aplies for all source files which
> is certainly not what I want - instead I only want to suppress this
> one warning about assignment inside condition where the comment
> states that its ugly but wanted, while at all other places the very
> same warning is important and useful since you can just acciedently
> miss a 2nd '=' where you dont want to assign but only compare.
> I even expect to add more pragmas for other compilers, f.e. gcc, at
> this place if we would compile with all possible warnings (maybe
> -Wall is already enough).

This is pretty ugly, please don't.  If you think this warning from this 
compiler matters so much, set up some kind of CI system which alerts you 
when they are introduced.  Littering platform-independent parts of the 
source with ugly #pragmas is not improving the quality of the source 
code in any way.

Regards, Joe

Mime
View raw message