From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3495 invoked by alias); 22 May 2014 17:34:44 -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 3479 invoked by uid 89); 22 May 2014 17:34:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-ob0-f171.google.com Received: from mail-ob0-f171.google.com (HELO mail-ob0-f171.google.com) (209.85.214.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Thu, 22 May 2014 17:34:42 +0000 Received: by mail-ob0-f171.google.com with SMTP id wn1so4200196obc.2 for ; Thu, 22 May 2014 10:34:40 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.60.62.211 with SMTP id a19mr28218240oes.71.1400780080405; Thu, 22 May 2014 10:34:40 -0700 (PDT) Received: by 10.60.31.65 with HTTP; Thu, 22 May 2014 10:34:40 -0700 (PDT) In-Reply-To: <20140522150956.GC4031@elastic.org> References: <20140522052921.GA30609@chokladfabriken.org> <20140522150956.GC4031@elastic.org> Date: Thu, 22 May 2014 17:34:00 -0000 Message-ID: Subject: Re: [PATCH] Make large enum constants unsigned From: Stefan Kristiansson To: "Frank Ch. Eigler" Cc: Stefan Kristiansson , cgen@sourceware.org, Alan Modra , fche@sourceware.org, Christian Svensson , Pierre Muller , "Maciej W. Rozycki" Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2014-q2/txt/msg00013.txt.bz2 On Thu, May 22, 2014 at 6:09 PM, Frank Ch. Eigler wrote: > Have you thought of having cgen emit it as > > (string-append "(signed int)" (number->string (cadr e))) > Ignoring the 'string-upcase' that would turn that into "(SIGNED INT)", how would that be better than? (string-append (number->string (cadr e)) "U") I dismissed that, since it would create a lot larger diff in generated files than in the isolated cases where it's actually a problem. > ... or even find a number->string conversion function that takes into > account the destionation language's encoding constraints. > That might certainly be an option, but way over my current Scheme capabilities. If you give me some pointers I could try to improve them. Stefan