This is the mail archive of the cgen@sourceware.org mailing list for the CGEN project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Make large enum constants unsigned


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]