From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28584 invoked by alias); 28 Jun 2005 20:18:15 -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 28569 invoked by uid 22791); 28 Jun 2005 20:18:10 -0000 Received: from sadr.equallogic.com (HELO sadr.equallogic.com) (66.155.203.134) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 28 Jun 2005 20:18:10 +0000 Received: from sadr.equallogic.com (localhost.localdomain [127.0.0.1]) by sadr.equallogic.com (8.12.8/8.12.8) with ESMTP id j5SKI5Zd013772 for ; Tue, 28 Jun 2005 16:18:08 -0400 Received: from M31.equallogic.com (M31.equallogic.com [172.16.1.31]) by sadr.equallogic.com (8.12.8/8.12.8) with SMTP id j5SKI4Nd013767; Tue, 28 Jun 2005 16:18:04 -0400 Received: from pkoning.equallogic.com ([172.16.1.163]) by M31.equallogic.com with Microsoft SMTPSVC(6.0.3790.211); Tue, 28 Jun 2005 16:18:04 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17089.45177.781373.794318@gargle.gargle.HOWL> Date: Tue, 28 Jun 2005 20:18:00 -0000 From: Paul Koning To: dewar@adacore.com Cc: galibert@pobox.com, dave.korn@artimi.com, aph@redhat.com, gdr@integrable-solutions.net, pinskia@physics.uc.edu, gcc@gcc.gnu.org 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> X-SW-Source: 2005-06/txt/msg01193.txt.bz2 >>>>> "Robert" == Robert Dewar writes: Robert> I am puzzled, why would *ANYONE* who knows C use int rather Robert> than unsigned if they want wrap around semantics? Because most people don't follow the rule that "always use unsigned variables unless you know that it really needs to be signed". And also because most people believe that C applies normal computer arithmetic, and they believe that normal computer arithmetic is wrapped 2's complement. (And indeed it usually is, give or take some bizarre exceptions like MAX_INT % -1) We all know better, but how tiny is the fraction of C programmers who have ever even *seen* the ANSI C spec, much less know in detail what it says? paul