From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29470 invoked by alias); 22 May 2014 06:22:15 -0000 Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org Received: (qmail 29450 invoked by uid 89); 22 May 2014 06:22:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 May 2014 06:22:13 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WnMOG-0004IO-4D from Maciej_Rozycki@mentor.com ; Wed, 21 May 2014 23:22:08 -0700 Received: from SVR-IES-FEM-02.mgc.mentorg.com ([137.202.0.106]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 21 May 2014 23:22:08 -0700 Received: from localhost (137.202.0.76) by SVR-IES-FEM-02.mgc.mentorg.com (137.202.0.106) with Microsoft SMTP Server (TLS) id 14.2.247.3; Thu, 22 May 2014 07:22:06 +0100 Date: Thu, 22 May 2014 06:22:00 -0000 From: "Maciej W. Rozycki" To: Stefan Kristiansson CC: , Alan Modra , , Christian Svensson , Pierre Muller Subject: Re: [PATCH] Make large enum constants unsigned In-Reply-To: <20140522052921.GA30609@chokladfabriken.org> Message-ID: References: <20140522052921.GA30609@chokladfabriken.org> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2014-q2/txt/msg00006.txt.bz2 On Thu, 22 May 2014, Stefan Kristiansson wrote: > this fixes a bug noted in two threads on the binutils mailing list: > https://sourceware.org/ml/binutils/2014-05/msg00152.html > https://sourceware.org/ml/binutils/2014-05/msg00195.html > > Both threads describe the problem pretty well, but the gist of it > is that constants are generated that will be interpreted as signed. > > 2014-05-22 Stefan Kristiansson > > * enum.scm (gen-enum-decl): Emit 'ULL' after constants larger than > #x80000000 Well, `ULL' is non-standard for pre-C99 compilers and also not needed because an enum will never have a type that is wider than `int'. So for portability's sake I suggest that you use `U' or `u' as I proposed (I prefer lowercase `u' for decimal constants because I find it easier to spot among digits, however please feel free to take your pick). Maciej