From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5105 invoked by alias); 24 Nov 2001 03:56:04 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 5068 invoked by uid 71); 24 Nov 2001 03:56:01 -0000 Resent-Date: 24 Nov 2001 03:56:01 -0000 Resent-Message-ID: <20011124035601.5067.qmail@sourceware.cygnus.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, inouk@igt.net Received:(qmail 4385 invoked by uid 61); 24 Nov 2001 03:52:37 -0000 Message-Id:<20011124035237.4379.qmail@sourceware.cygnus.com> Date: Mon, 19 Nov 2001 21:29:00 -0000 From: inouk@igt.net Reply-To: inouk@igt.net To: gcc-gnats@gcc.gnu.org X-Send-Pr-Version:gnatsweb-2.9.2 (1.1.1.1.2.21) Subject: c/4938: bad warnings about signed and unsigned X-SW-Source: 2001-11/txt/msg00573.txt.bz2 List-Id: >Number: 4938 >Category: c >Synopsis: bad warnings about signed and unsigned >Confidential: no >Severity: non-critical >Priority: low >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Fri Nov 23 19:56:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: inouk@igt.net >Release: unknown-1.0 >Organization: >Environment: Debian GNU/Linux GCC version 2.95 and 3.0 >Description: The range of signed int is between -2147483648 and 2147483647 unsigned int between 0 and 4294967295 here a sample code: 1 int main(void) { 2 3 unsigned int test; 4 int test1; 5 6 test = 4294967295; 7 test = 2147483648; 8 test = 2147483647; 9 10 test1 = 2147483647; 11 test1 = -2147483648; 12 test1 = -2147483647; 13 } I compile this and I have: gcc t2.c t2.c: In function `main': t2.c:6: warning: decimal constant is so large that it is unsigned t2.c:7: warning: decimal constant is so large that it is unsigned t2.c:11: warning: decimal constant is so large that it is unsigned I have a little difference with short, I never see warnings. signed short: -32768 to 32767 unsigned short: 0 to 65535 sample code: 1 int main(void) { 2 3 unsigned short test; 4 short test1; 5 6 test = 65535; 7 8 test1 = 65535; 9 test1 = 32767; 10 } nothing about warning. But, i "overflowed" test1 (in line 8). >How-To-Repeat: go to description >Fix: Better handling warnings :) >Release-Note: >Audit-Trail: >Unformatted: