or1k/opcodes: ISO C version compatibility issues
Stefan Kristiansson
stefan.kristiansson@saunalahti.fi
Wed May 21 21:56:00 GMT 2014
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?)
More information about the Binutils
mailing list