From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10705 invoked by alias); 21 May 2014 21:56:34 -0000 Mailing-List: contact cgen-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cgen-owner@sourceware.org Received: (qmail 10682 invoked by uid 89); 21 May 2014 21:56:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_40,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp.nebula.fi Received: from smtp-69.nebula.fi (HELO smtp.nebula.fi) (83.145.220.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 21 May 2014 21:56:31 +0000 Received: from chokladfabriken.org (nblzone-224-141.nblnetworks.fi [83.145.224.141]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.nebula.fi (Postfix) with ESMTPS id 253E2D01A48; Thu, 22 May 2014 00:56:26 +0300 (EEST) Date: Wed, 21 May 2014 21:56:00 -0000 From: Stefan Kristiansson To: Peter Gavin , "Maciej W. Rozycki" Cc: Christian Svensson , binutils@sourceware.org, cgen@sourceware.org Subject: Re: or1k/opcodes: ISO C version compatibility issues Message-ID: <20140521215549.GA22614@chokladfabriken.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-q2/txt/msg00003.txt.bz2 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 > 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?)