Bug#190757: marked as done (please add a warning for conversion from "int" to "unsigned int")
Your message dated Fri, 25 Apr 2003 21:09:14 +0200
with message-id <20030425190914.GA367@aragorn>
and subject line Bug#190757: please add a warning for conversion from "int" to "unsigned int"
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--------------------------------------
Received: (at submit) by bugs.debian.org; 25 Apr 2003 15:42:06 +0000
>From rmh@khazad.dyndns.org Fri Apr 25 10:42:05 2003
Return-path: <rmh@khazad.dyndns.org>
Received: from 80-24-13-86.uc.nombres.ttd.es (getyouriso.dyndns.org) [80.24.13.86]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 1995Kr-0002zY-00; Fri, 25 Apr 2003 10:42:03 -0500
Received: from aragorn ([192.168.0.3])
by getyouriso.dyndns.org with esmtp (Exim 3.35 #1 (Debian))
id 1996Xh-0001aO-00; Fri, 25 Apr 2003 18:59:21 +0200
Received: from rmh by aragorn with local (Exim 3.36 #1 (Debian))
id 1995KC-0001Pm-00; Fri, 25 Apr 2003 17:41:20 +0200
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Robert Millan <rmh@debian.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: please add a warning for conversion from "int" to "unsigned int"
X-Mailer: reportbug 2.10.1
Date: Fri, 25 Apr 2003 17:41:20 +0200
Message-Id: <E1995KC-0001Pm-00@aragorn>
Sender: Robert Millan <rmh@khazad.dyndns.org>
Delivered-To: submit@bugs.debian.org
X-Spam-Status: No, hits=-6.0 required=4.0
tests=BAYES_01,HAS_PACKAGE
version=2.53
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
Package: gcc-3.2
Version: 1:3.2.3-0pre9
Severity: wishlist
the following code (compiled with -Wall -pedantic) could be
considered "buggy", because it implicitly converts a
signed int to unsigned int when calling "a". if you run it,
it will print the number 2^32-1 instead of -1.
#include <stdio.h>
int a (unsigned int b)
{
return printf ("%u\n", b);
}
int main ()
{
return a (-1);
}
this can lead to programming bugs. to prevent a programmer from
such, i'd appreciate if gcc said something like:
warning: implicit conversion from signed to unsigned
when asked to compile this code.
maybe it makes sense to warn about conversion from unsigned to
signed too, although having problems with this is unlikely,
since bit overflow only happens with really big numbers.
-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux aragorn 2.2.22 #1 dl nov 25 21:59:43 CET 2002 i586
Locale: LANG=ca_ES.ISO-8859-1, LC_CTYPE=ca_ES@euro (ignored: LC_ALL set)
Versions of packages gcc-3.2 depends on:
ii binutils 2.13.90.0.18-1.7 The GNU assembler, linker and bina
ii cpp-3.2 1:3.2.3-0pre9 The GNU C preprocessor
ii gcc-3.2-base 1:3.2.3-0pre9 The GNU Compiler Collection (base
ii libc6 2.3.1-17 GNU C Library: Shared libraries an
ii libgcc1 1:3.3-0pre5 GCC support library
-- no debconf information
---------------------------------------
Received: (at 190757-done) by bugs.debian.org; 25 Apr 2003 19:10:28 +0000
>From rmh@khazad.dyndns.org Fri Apr 25 14:10:27 2003
Return-path: <rmh@khazad.dyndns.org>
Received: from 80-24-13-86.uc.nombres.ttd.es (getyouriso.dyndns.org) [80.24.13.86]
by master.debian.org with esmtp (Exim 3.12 1 (Debian))
id 1998aT-0004M1-00; Fri, 25 Apr 2003 14:10:23 -0500
Received: from aragorn ([192.168.0.3])
by getyouriso.dyndns.org with esmtp (Exim 3.35 #1 (Debian))
id 1999nC-0001l4-00; Fri, 25 Apr 2003 22:27:34 +0200
Received: from rmh by aragorn with local (Exim 3.36 #1 (Debian))
id 1998ZQ-00006e-00; Fri, 25 Apr 2003 21:09:16 +0200
Date: Fri, 25 Apr 2003 21:09:14 +0200
From: Robert Millan <zeratul2@wanadoo.es>
To: Daniel Jacobowitz <dan@debian.org>
Cc: 190757-done@bugs.debian.org
Subject: Re: Bug#190757: please add a warning for conversion from "int" to "unsigned int"
Message-ID: <20030425190914.GA367@aragorn>
References: <E1995KC-0001Pm-00@aragorn> <20030425181818.GA17351@nevyn.them.org> <20030425184011.GA1345@aragorn> <20030425184827.GA18028@nevyn.them.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <20030425184827.GA18028@nevyn.them.org>
Organisation: free as in freedom
User-Agent: Mutt/1.5.4i
Sender: Robert Millan <rmh@khazad.dyndns.org>
Delivered-To: 190757-done@bugs.debian.org
X-Spam-Status: No, hits=-26.9 required=4.0
tests=BAYES_01,EMAIL_ATTRIBUTION,IN_REP_TO,QUOTED_EMAIL_TEXT,
REFERENCES,REPLY_WITH_QUOTES,SIGNATURE_SHORT_SPARSE,
USER_AGENT_MUTT
autolearn=ham version=2.53
X-Spam-Level:
X-Spam-Checker-Version: SpamAssassin 2.53 (1.174.2.15-2003-03-30-exp)
On Fri, Apr 25, 2003 at 02:48:27PM -0400, Daniel Jacobowitz wrote:
>
> No, the decision was made after looking at the false positive rate. I
> recommend you read the manual if you want to know what GCC warnings do.
> It's not quite as clear as it could be, but -Wall is in the middle of
> the page, and says "all warnings above here".
ok, closing.
--
Robert Millan
make: *** No rule to make target `war'. Stop.
Another world is possible - Just say no to genocide
Reply to: