This is the mail archive of the
cgen@sourceware.org
mailing list for the CGEN project.
Re: or1k/opcodes: ISO C version compatibility issues
- From: Stefan Kristiansson <stefan dot kristiansson at saunalahti dot fi>
- To: Peter Gavin <pgavin at gmail dot com>, "Maciej W. Rozycki" <macro at codesourcery dot com>
- Cc: Christian Svensson <blue at cmd dot nu>, binutils at sourceware dot org, cgen at sourceware dot org
- Date: Thu, 22 May 2014 00:55:50 +0300
- Subject: Re: or1k/opcodes: ISO C version compatibility issues
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot DEB dot 1 dot 10 dot 1405212057020 dot 512 at tp dot orcam dot me dot uk> <CAKEMJMpBnxeNaBUm+jktE0renhHP1Wwzf70=R3iXnuP+hz5D=g at mail dot gmail dot com>
On Wed, May 21, 2014 at 04:47:20PM -0400, Peter Gavin wrote:
> On Wed, May 21, 2014 at 4:44 PM, Maciej W. Rozycki
> <macro@codesourcery.com>wrote:
>
> > (also for or1k-desc.c). I have been able to make the files compile with
> > the change below, however these are generated files and a suitable change
> > would have to be applied to cpu/or1kcommon.cpu instead. Unfortunately
> > that source has been written in Scheme that I have no immediate skills to
> > correct. Would you please look into making the correct update to the
> > Scheme source?
> >
>
> I think this is actually a bug in CGEN, and needs to be changed there.
>
Without claiming any scheme skills, I think something like the patch below
should do it.
Stefan
diff --git a/cgen/enum.scm b/cgen/enum.scm
index 4279b00..d56a1a3 100644
--- a/cgen/enum.scm
+++ b/cgen/enum.scm
@@ -298,7 +298,10 @@
""
(string-append " = "
(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?)