From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14413 invoked by alias); 26 Jul 2005 21:54:08 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 14398 invoked by uid 22791); 26 Jul 2005 21:54:05 -0000 Received: from smtp-102-tuesday.nerim.net (HELO kraid.nerim.net) (62.4.16.102) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 26 Jul 2005 21:54:05 +0000 Received: from uniton.integrable-solutions.net (gdr.net1.nerim.net [62.212.99.186]) by kraid.nerim.net (Postfix) with ESMTP id 8AB4F40E26; Tue, 26 Jul 2005 23:54:02 +0200 (CEST) Received: from uniton.integrable-solutions.net (localhost [127.0.0.1]) by uniton.integrable-solutions.net (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id j6QLqPpI013864; Tue, 26 Jul 2005 23:52:26 +0200 Received: (from gdr@localhost) by uniton.integrable-solutions.net (8.12.10/8.12.10/Submit) id j6QLqPNh013863; Tue, 26 Jul 2005 23:52:25 +0200 To: Martin Wodok Cc: gcc-help@gcc.gnu.org Subject: Re: C++: No Warning for passing value > 255 as parameter to a function requiring "unsigned char" References: <200507221551.02486.m.wodok@osb-ag.de> <200507261115.45744.m.wodok@osb-ag.de> From: Gabriel Dos Reis In-Reply-To: <200507261115.45744.m.wodok@osb-ag.de> Date: Tue, 26 Jul 2005 21:54:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-07/txt/msg00289.txt.bz2 Martin Wodok writes: | Hi Gaby | hi Eljay, | | thanks for your answer! | | > Martin Wodok writes: | > | Assigning 1000 is of course out of bounds for "unsigned char", thus the | > | > No, it is not. Unsigned integer types are modulo types; it is no overflow. | | Yes, they're modulo types, that's why this is NOT an error, The argument was that it makes sense to issue a warning when the the code is dubious -- not just an error. However, in this case, modulo arithmetic for unsigned int is a characteristic propery. Consequently, it does not make much sense to warn about it. -- Gaby