* or1k/opcodes: ISO C version compatibility issues
@ 2014-05-21 20:45 Maciej W. Rozycki
[not found] ` <CAKEMJMpBnxeNaBUm+jktE0renhHP1Wwzf70=R3iXnuP+hz5D=g@mail.gmail.com>
0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2014-05-21 20:45 UTC (permalink / raw)
To: Christian Svensson, Stefan Kristiansson; +Cc: binutils
Hi,
When building GDB with --enable-targets=all for the i686-pc-linux-gnu
host using GCC 4.3.3 I've tripped over these errors:
cc1: warnings being treated as errors
In file included from .../opcodes/or1k-asm.c:34:
.../opcodes/or1k-desc.h:260: error: this decimal constant is unsigned only in ISO C90
.../opcodes/or1k-desc.h:263: error: this decimal constant is unsigned only in ISO C90
.../opcodes/or1k-desc.h:270: error: this decimal constant is unsigned only in ISO C90
make[4]: *** [or1k-asm.lo] Error 1
(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?
Maciej
gdb-opcodes-or1k-unsigned.diff
Index: gdb-fsf-trunk-quilt/opcodes/or1k-desc.h
===================================================================
--- gdb-fsf-trunk-quilt.orig/opcodes/or1k-desc.h 2014-05-13 02:52:15.000000000 +0100
+++ gdb-fsf-trunk-quilt/opcodes/or1k-desc.h 2014-05-13 03:02:36.919016281 +0100
@@ -257,17 +257,17 @@ typedef enum spr_field_lsbs {
/* Enum declaration for SPR field masks. */
typedef enum spr_field_masks {
- SPR_FIELD_MASK_SYS_VR_REV = 63, SPR_FIELD_MASK_SYS_VR_CFG = 16711680, SPR_FIELD_MASK_SYS_VR_VER = 4278190080, SPR_FIELD_MASK_SYS_UPR_UP = 1
+ SPR_FIELD_MASK_SYS_VR_REV = 63, SPR_FIELD_MASK_SYS_VR_CFG = 16711680, SPR_FIELD_MASK_SYS_VR_VER = 4278190080u, SPR_FIELD_MASK_SYS_UPR_UP = 1
, SPR_FIELD_MASK_SYS_UPR_DCP = 2, SPR_FIELD_MASK_SYS_UPR_ICP = 4, SPR_FIELD_MASK_SYS_UPR_DMP = 8, SPR_FIELD_MASK_SYS_UPR_MP = 16
, SPR_FIELD_MASK_SYS_UPR_IMP = 32, SPR_FIELD_MASK_SYS_UPR_DUP = 64, SPR_FIELD_MASK_SYS_UPR_PCUP = 128, SPR_FIELD_MASK_SYS_UPR_PICP = 256
- , SPR_FIELD_MASK_SYS_UPR_PMP = 512, SPR_FIELD_MASK_SYS_UPR_TTP = 1024, SPR_FIELD_MASK_SYS_UPR_CUP = 4278190080, SPR_FIELD_MASK_SYS_CPUCFGR_NSGR = 15
+ , SPR_FIELD_MASK_SYS_UPR_PMP = 512, SPR_FIELD_MASK_SYS_UPR_TTP = 1024, SPR_FIELD_MASK_SYS_UPR_CUP = 4278190080u, SPR_FIELD_MASK_SYS_CPUCFGR_NSGR = 15
, SPR_FIELD_MASK_SYS_CPUCFGR_CGF = 16, SPR_FIELD_MASK_SYS_CPUCFGR_OB32S = 32, SPR_FIELD_MASK_SYS_CPUCFGR_OB64S = 64, SPR_FIELD_MASK_SYS_CPUCFGR_OF32S = 128
, SPR_FIELD_MASK_SYS_CPUCFGR_OF64S = 256, SPR_FIELD_MASK_SYS_CPUCFGR_OV64S = 512, SPR_FIELD_MASK_SYS_CPUCFGR_ND = 1024, SPR_FIELD_MASK_SYS_SR_SM = 1
, SPR_FIELD_MASK_SYS_SR_TEE = 2, SPR_FIELD_MASK_SYS_SR_IEE = 4, SPR_FIELD_MASK_SYS_SR_DCE = 8, SPR_FIELD_MASK_SYS_SR_ICE = 16
, SPR_FIELD_MASK_SYS_SR_DME = 32, SPR_FIELD_MASK_SYS_SR_IME = 64, SPR_FIELD_MASK_SYS_SR_LEE = 128, SPR_FIELD_MASK_SYS_SR_CE = 256
, SPR_FIELD_MASK_SYS_SR_F = 512, SPR_FIELD_MASK_SYS_SR_CY = 1024, SPR_FIELD_MASK_SYS_SR_OV = 2048, SPR_FIELD_MASK_SYS_SR_OVE = 4096
, SPR_FIELD_MASK_SYS_SR_DSX = 8192, SPR_FIELD_MASK_SYS_SR_EPH = 16384, SPR_FIELD_MASK_SYS_SR_FO = 32768, SPR_FIELD_MASK_SYS_SR_SUMRA = 65536
- , SPR_FIELD_MASK_SYS_SR_CID = 4026531840, SPR_FIELD_MASK_SYS_FPCSR_FPEE = 1, SPR_FIELD_MASK_SYS_FPCSR_RM = 6, SPR_FIELD_MASK_SYS_FPCSR_OVF = 8
+ , SPR_FIELD_MASK_SYS_SR_CID = 4026531840u, SPR_FIELD_MASK_SYS_FPCSR_FPEE = 1, SPR_FIELD_MASK_SYS_FPCSR_RM = 6, SPR_FIELD_MASK_SYS_FPCSR_OVF = 8
, SPR_FIELD_MASK_SYS_FPCSR_UNF = 16, SPR_FIELD_MASK_SYS_FPCSR_SNF = 32, SPR_FIELD_MASK_SYS_FPCSR_QNF = 64, SPR_FIELD_MASK_SYS_FPCSR_ZF = 128
, SPR_FIELD_MASK_SYS_FPCSR_IXF = 256, SPR_FIELD_MASK_SYS_FPCSR_IVF = 512, SPR_FIELD_MASK_SYS_FPCSR_INF = 1024, SPR_FIELD_MASK_SYS_FPCSR_DZF = 2048
} SPR_FIELD_MASKS;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: or1k/opcodes: ISO C version compatibility issues
[not found] ` <CAKEMJMpBnxeNaBUm+jktE0renhHP1Wwzf70=R3iXnuP+hz5D=g@mail.gmail.com>
@ 2014-05-21 21:56 ` Stefan Kristiansson
2014-05-21 23:58 ` Alan Modra
0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kristiansson @ 2014-05-21 21:56 UTC (permalink / raw)
To: Peter Gavin, Maciej W. Rozycki; +Cc: Christian Svensson, binutils, cgen
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?)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: or1k/opcodes: ISO C version compatibility issues
2014-05-21 21:56 ` Stefan Kristiansson
@ 2014-05-21 23:58 ` Alan Modra
0 siblings, 0 replies; 3+ messages in thread
From: Alan Modra @ 2014-05-21 23:58 UTC (permalink / raw)
To: Stefan Kristiansson
Cc: Peter Gavin, Maciej W. Rozycki, Christian Svensson, binutils, cgen
On Thu, May 22, 2014 at 12:55:50AM +0300, Stefan Kristiansson wrote:
> 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.
See also https://sourceware.org/ml/binutils/2014-05/msg00173.html
--
Alan Modra
Australia Development Lab, IBM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-21 23:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-21 20:45 or1k/opcodes: ISO C version compatibility issues Maciej W. Rozycki
[not found] ` <CAKEMJMpBnxeNaBUm+jktE0renhHP1Wwzf70=R3iXnuP+hz5D=g@mail.gmail.com>
2014-05-21 21:56 ` Stefan Kristiansson
2014-05-21 23:58 ` Alan Modra
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).