From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1225 invoked by alias); 2 Jul 2005 17:15:23 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 1146 invoked by uid 22791); 2 Jul 2005 17:15:21 -0000 Received: from mail.enyo.de (HELO mail.enyo.de) (212.9.189.167) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sat, 02 Jul 2005 17:15:20 +0000 Received: from deneb.enyo.de ([2001:14b0:202:1::ab]) by albireo.enyo.de with esmtp id 1Dola7-0006qi-FN; Sat, 02 Jul 2005 19:15:07 +0200 Received: from fw by deneb.enyo.de with local (Exim 4.50) id 1Dola0-0003Vt-GY; Sat, 02 Jul 2005 19:15:00 +0200 From: Florian Weimer To: Robert Dewar Cc: Olivier Galibert , Dave Korn , 'Andrew Haley' , 'Gabriel Dos Reis' , 'Andrew Pinski' , 'gcc mailing list' Subject: Re: signed is undefined and has been since 1992 (in GCC) References: <20050628171752.GE52889@dspnet.fr.eu.org> <20050628180203.GG52889@dspnet.fr.eu.org> <42C19C5A.2040705@adacore.com> <20050628191746.GJ52889@dspnet.fr.eu.org> <42C1A318.4040407@adacore.com> Date: Sat, 02 Jul 2005 17:15:00 -0000 In-Reply-To: <42C1A318.4040407@adacore.com> (Robert Dewar's message of "Tue, 28 Jun 2005 15:20:56 -0400") Message-ID: <8764vt2kq3.fsf@deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2005-07/txt/msg00068.txt.bz2 * Robert Dewar: > I am puzzled, why would *ANYONE* who knows C use int > rather than unsigned if they want wrap around semantics? Both OpenSSL and Apache programmers did this, in carefully reviewed code which was written in response to a security report. They simply didn't know that there is a potential problem. The reason for this gap in knowledge isn't quite clear to me. Probably it's hard to accept for hard-code C coders that a program which generates correct machine code with all GCC versions released so far (modulo bugs in GCC) can still be illegal C and exhibit undefined behavior. IIRC, I needed quite some time to realize the full impact of this distinction.