Re: [PATCH] Make large enum constants unsigned
Stefan Kristiansson <stefan.kristiansson <at> saunalahti.fi>
2014-05-29 20:08:21 GMT
On Thu, May 22, 2014 at 05:06:21PM -0400, Frank Ch. Eigler wrote:
> Hi -
> > > (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.
> > 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. [...]
> IMHO, that's not such a big deal. We don't usually look closely at
> the diffs of generated files, once the generating tools are trustworthy.
Ok, that's fine by me if others are ok with it.
Below is the patch that does that.
2014-05-29 Stefan Kristiansson <stefan.kristiansson <at> saunalahti.fi>
* enum.scm (gen-enum-decl): Emit 'U' after constants.
RCS file: /cvs/src/src/cgen/enum.scm,v
retrieving revision 1.13