From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16119 invoked by alias); 22 May 2014 21:42:36 -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 16097 invoked by uid 89); 22 May 2014 21:42:36 -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 21:42:35 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Wnakw-0001qj-52 from Maciej_Rozycki@mentor.com ; Thu, 22 May 2014 14:42:30 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 22 May 2014 14:42:30 -0700 Received: from localhost (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.2.247.3; Thu, 22 May 2014 22:42:27 +0100 Date: Thu, 22 May 2014 21:42:00 -0000 From: "Maciej W. Rozycki" To: "Frank Ch. Eigler" CC: Stefan Kristiansson , , Alan Modra , , Christian Svensson , Pierre Muller Subject: Re: [PATCH] Make large enum constants unsigned In-Reply-To: <20140522210621.GF4031@elastic.org> Message-ID: References: <20140522052921.GA30609@chokladfabriken.org> <20140522150956.GC4031@elastic.org> <20140522210621.GF4031@elastic.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/msg00015.txt.bz2 On Thu, 22 May 2014, Frank Ch. Eigler wrote: > > > (string-append "(signed int)" (number->string (cadr e))) > > [...] > > how would that be better than? > > (string-append (number->string (cadr e)) "U") > > It would be a closer match to expressing our desire to match C enum > typing, but I'd be fine with "U" suffixing too. TBH I don't understand what you mean here, a C compiler is free to choose from `char', `int' and `unsigned int' as the underlying (compatible) type of an enumeration as long as the type can represent all the member values defined. How exactly the signed `int' type is going to be advantageous over the `unsigned int' type here? If this is used to produce a bit mask, which I gather it is, then I find using an unsigned type more natural. Maciej