c/10604: -Wall includes sign conversion warning [3.3 regression]

ak@suse.de ak@suse.de
Fri May 2 18:37:00 GMT 2003

>Number:         10604
>Category:       c
>Synopsis:       -Wall includes sign conversion warning [3.3 regression]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 02 18:36:01 UTC 2003
>Originator:     Andi Kleen
>Release:        gcc 3.3

gcc 3.2 did not included signed<->unsigned conversion warnings in -Wall. gcc 3.3 does. This causes incredible noise in building some projects with -Wall like the linux kernel. It also breaks some other projects that use -Werror -Wall. Fixing the warning correctly is usually a lot of work because it requires careful code review. 

In gcc 3.2 this was only in -W, now it's in -Wall
It can be worked around by specifying -Wno-sign-compare,
but -Wall should not change this way between releases.
see attachment. with gcc 3.3:

% /pkg/gcc-3.3-030124/bin/gcc -Wall tsign.c 
tsign.c: In function `f':
tsign.c:4: warning: comparison between signed and unsigned

with 3.2:
% gcc -Wall tsign.c -c

(no warning) 

Remove -Wsign-compare from -Wall
Content-Type: text/plain; name="tsign.c"
Content-Disposition: inline; filename="tsign.c"

int f(unsigned a, int b) 
	return a < b;

More information about the Gcc-bugs mailing list