public inbox for cgen@sourceware.org
 help / color / mirror / Atom feed
From: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
To: Peter Gavin <pgavin@gmail.com>,
	"Maciej W. Rozycki" <macro@codesourcery.com>
Cc: Christian Svensson <blue@cmd.nu>,
	binutils@sourceware.org,	cgen@sourceware.org
Subject: Re: or1k/opcodes: ISO C version compatibility issues
Date: Wed, 21 May 2014 21:56:00 -0000	[thread overview]
Message-ID: <20140521215549.GA22614@chokladfabriken.org> (raw)
In-Reply-To: <CAKEMJMpBnxeNaBUm+jktE0renhHP1Wwzf70=R3iXnuP+hz5D=g@mail.gmail.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?)

       reply	other threads:[~2014-05-21 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <alpine.DEB.1.10.1405212057020.512@tp.orcam.me.uk>
     [not found] ` <CAKEMJMpBnxeNaBUm+jktE0renhHP1Wwzf70=R3iXnuP+hz5D=g@mail.gmail.com>
2014-05-21 21:56   ` Stefan Kristiansson [this message]
2014-05-21 23:58     ` Alan Modra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140521215549.GA22614@chokladfabriken.org \
    --to=stefan.kristiansson@saunalahti.fi \
    --cc=binutils@sourceware.org \
    --cc=blue@cmd.nu \
    --cc=cgen@sourceware.org \
    --cc=macro@codesourcery.com \
    --cc=pgavin@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).