This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
Re: [PATCH] Make large enum constants unsigned
- From: Stefan Kristiansson <stefan dot kristiansson at saunalahti dot fi>
- To: "Frank Ch. Eigler" <fche at elastic dot org>
- Cc: Stefan Kristiansson <stefan dot kristiansson at saunalahti dot fi>, cgen at sourceware dot org, Alan Modra <amodra at gmail dot com>, fche at sourceware dot org, Christian Svensson <blue at cmd dot nu>, Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, "Maciej W. Rozycki" <macro at codesourcery dot com>
- Date: Thu, 22 May 2014 20:34:40 +0300
- Subject: Re: [PATCH] Make large enum constants unsigned
- Authentication-results: sourceware.org; auth=none
- References: <20140522052921 dot GA30609 at chokladfabriken dot org> <20140522150956 dot GC4031 at elastic dot org>
On Thu, May 22, 2014 at 6:09 PM, Frank Ch. Eigler <fche@elastic.org> 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