public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] disable gcc warnings of sign/unsigned comparison
@ 2004-01-01 12:33 Paul Jackson
  2004-01-01 17:14 ` Trond Myklebust
  0 siblings, 1 reply; 16+ messages in thread
From: Paul Jackson @ 2004-01-01 12:33 UTC (permalink / raw)
  To: Andrew Morton, linux-kernel@vger.kernel.org

Andrew,

Please consider applying the following patch.

This patch turns off all gcc warnings on comparing signed with unsigned
numbers, by setting the gcc option -Wno-sign-compare in the top
Makefile.

These warnings state:

  warning: comparison between signed and unsigned

This patch is a "personal preference" decision.  If you choose to
reject it, I seek no justifications.

I like it, and at least with the version of gcc I happen to be using
(3.3), find it really helps.  This version of gcc dumps out many such
complaints otherwise.

And one could make a case that Linus would like this patch, from his
remark of a couple months ago, on a thread with the Subject of:

  [PATCH] irda: fix type of struct irda_ias_set.attribute.irda_attrib_string.len

in which Linus wrote:
> That's why I hate the "sign compare" warning of gcc so much - it warns 
> about things that you CANNOT sanely write in any other way. That makes 
> that particular warning _evil_, since it encourages people to write crap 
> code.

But what Linus actually thinks of this, I've no further clues.

The patch was computed against 2.6.0-mm2.

Thank-you for your consideration.


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.1536  -> 1.1537 
#	            Makefile	1.441   -> 1.442  
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 04/01/01	pj@sgi.com	1.1537
# ignore gcc sign compare warnings
# --------------------------------------------
#
diff -Nru a/Makefile b/Makefile
--- a/Makefile	Thu Jan  1 04:13:04 2004
+++ b/Makefile	Thu Jan  1 04:13:04 2004
@@ -161,7 +161,7 @@
 
 HOSTCC  	= gcc
 HOSTCXX  	= g++
-HOSTCFLAGS	= -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS	= -Wall -Wstrict-prototypes -Wno-sign-compare -O2 -fomit-frame-pointer
 HOSTCXXFLAGS	= -O2
 
 # 	Decide whether to build built-in, modular, or both.
@@ -275,7 +275,7 @@
 CPPFLAGS        := -D__KERNEL__ -Iinclude \
 		   $(if $(KBUILD_SRC),-Iinclude2 -I$(srctree)/include)
 
-CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-trigraphs \
+CFLAGS 		:= -Wall -Wstrict-prototypes -Wno-sign-compare -Wno-trigraphs \
 	  	   -fno-strict-aliasing -fno-common
 AFLAGS		:= -D__ASSEMBLY__
 



-- 
                          I won't rest till it's the best ...
                          Programmer, Linux Scalability
                          Paul Jackson <pj@sgi.com> 1.650.933.1373

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2004-03-29 15:44 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <19ahq-7Rg-11@gated-at.bofh.it>
     [not found] ` <19eEs-5lC-15@gated-at.bofh.it>
     [not found]   ` <19kgS-4HT-19@gated-at.bofh.it>
2004-01-02  1:33     ` [PATCH] disable gcc warnings of sign/unsigned comparison Andi Kleen
2004-01-02  3:07       ` Paul Jackson
2004-01-05  1:41       ` Adrian Bunk
2004-01-05 13:16         ` Paul Jackson
2004-03-29 15:44         ` Paul Jackson
2004-03-29 15:43       ` Adrian Bunk
2004-01-01 12:33 Paul Jackson
2004-01-01 17:14 ` Trond Myklebust
2004-01-01 23:15   ` Paul Jackson
2004-01-01 23:33     ` Andrew Morton
2004-01-02  0:08       ` Tomas Szepe
2004-01-02  3:20       ` Paul Jackson
2004-01-02  0:46     ` Trond Myklebust
2004-01-02  0:59       ` Tomas Szepe
2004-01-02  1:31         ` Paul Jackson
2004-01-02  3:05       ` Paul Jackson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox