From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21841 invoked by alias); 22 May 2014 13:33:59 -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 21820 invoked by uid 89); 22 May 2014 13:33:58 -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,MSGID_MULTIPLE_AT autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mailhost.u-strasbg.fr Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.222.217) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 May 2014 13:33:53 +0000 Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antispam (Postfix) with ESMTP id 9A93D2222F; Thu, 22 May 2014 15:33:50 +0200 (CEST) Received: from mailhost.u-strasbg.fr (localhost [127.0.0.1]) by antivirus (Postfix) with ESMTP id 89A7D22283; Thu, 22 May 2014 15:33:50 +0200 (CEST) Received: from md13.u-strasbg.fr (md13.u-strasbg.fr [130.79.200.248]) by mr7.u-strasbg.fr (Postfix) with ESMTP id E49F02223C; Thu, 22 May 2014 15:33:43 +0200 (CEST) Received: from ms16.u-strasbg.fr (ms16.u-strasbg.fr [130.79.204.116]) by md13.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id s4MDXgG5029797 ; Thu, 22 May 2014 15:33:42 +0200 (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from E6510Muller (gw-ics.u-strasbg.fr [130.79.210.225]) (Authenticated sender: mullerp) by ms16.u-strasbg.fr (Postfix) with ESMTPSA id 234F71FD7C; Thu, 22 May 2014 15:33:37 +0200 (CEST) From: "Pierre Muller" To: "'Stefan Kristiansson'" , "'Maciej W. Rozycki'" Cc: , "'Alan Modra'" , , "'Christian Svensson'" References: <20140522052921.GA30609@chokladfabriken.org> <20140522071001.GA30918@chokladfabriken.org> In-Reply-To: <20140522071001.GA30918@chokladfabriken.org> Subject: RE: [PATCH] Make large enum constants unsigned Date: Thu, 22 May 2014 13:33:00 -0000 Message-ID: <00c201cf75c2$72e15930$58a40b90$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-SW-Source: 2014-q2/txt/msg00009.txt.bz2 Couldn't we support 64-bit constants already, by adding + (if (> (cadr e) + #x100000000) + "LL" "")) Right after the conditional "U" postfix? This way, the pre C-99 standard would only be violated when it is really required anyhow, no? Pierre Muller > -----Message d'origine----- > De=A0: Stefan Kristiansson [mailto:stefan.kristiansson@saunalahti.fi] > Envoy=E9=A0: jeudi 22 mai 2014 09:10 > =C0=A0: Maciej W. Rozycki > Cc=A0: cgen@sourceware.org; Alan Modra; fche@sourceware.org; Christian > Svensson; Pierre Muller > Objet=A0: Re: [PATCH] Make large enum constants unsigned >=20 > On Thu, May 22, 2014 at 09:52:50AM +0300, Stefan Kristiansson wrote: > > > > As for 'u' vs 'U', a 'U' is emitted in the .h file even if I put a > 'u' > > in the .scm. > > If 'u' in the output is preferred, maybe someone can point out the > > reason for this? > > >=20 > I found the reason, there's a 'string-upcase' a couple of rows above > what the patch touches. > I'm not sure getting around that is worth pursuing though? >=20 > Anyway, below is the updated patch. >=20 > 2014-05-22 Stefan Kristiansson >=20 > * enum.scm (gen-enum-decl): Emit 'U' after constants larger than > #x80000000 >=20 > Index: cgen/enum.scm > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > RCS file: /cvs/src/src/cgen/enum.scm,v > retrieving revision 1.13 > diff -u -r1.13 enum.scm > --- cgen/enum.scm 13 Feb 2010 03:39:15 -0000 1.13 > +++ cgen/enum.scm 22 May 2014 07:09:00 -0000 > @@ -298,7 +298,10 @@ > "" > (string-append " =3D " > (if (number? (cadr e)) > - (number->string (cadr e)) > + (string-append (number->string (cadr e)) > + (if (> (cadr e) > + #x80000000) > + "U" "")) > (cadr e)))) > )) > (if (and san? include-sanitize-marker?)