This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: build regression w/ --enable-targets=all && gcc-4.8+ [Re: [committed] Add structures to describe MIPS operands]
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: binutils at sourceware dot org
- Date: Wed, 17 Jul 2013 09:06:14 +0100
- Subject: Re: build regression w/ --enable-targets=all && gcc-4.8+ [Re: [committed] Add structures to describe MIPS operands]
- References: <87oba5z2w2 dot fsf at talisman dot default> <20130717042139 dot GA2444 at host2 dot jankratochvil dot net>
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> On Sun, 14 Jul 2013 15:29:01 +0200, Richard Sandiford wrote:
>> opcodes/
>> * mips-formats.h: New file.
>
> with gcc-4.8+
> FAIL: gcc (GCC) 4.8.2 20130717 (prerelease)
> FAIL: gcc (GCC) 4.9.0 20130717 (experimental)
> FAIL: gcc-4.8.1-1.fc19.x86_64
>
> I get with --enable-targets=all the warnings below, which break the build due
> to default -Werror.
Sorry, fixed as follows.
Richard
opcodes/
* mips-formats.h (MAPPED_INT, MAPPED_REG, REG_PAIR): Add
ATTRIBUTE_UNUSED.
Index: opcodes/mips-formats.h
===================================================================
--- opcodes/mips-formats.h 2013-07-17 08:57:32.007584602 +0100
+++ opcodes/mips-formats.h 2013-07-17 09:02:24.844132422 +0100
@@ -45,7 +45,8 @@ #define BIT(SIZE, LSB, BIAS) \
#define MAPPED_INT(SIZE, LSB, MAP, PRINT_HEX) \
{ \
- typedef char static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \
+ typedef char ATTRIBUTE_UNUSED \
+ static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \
static const struct mips_mapped_int_operand op = { \
{ OP_MAPPED_INT, SIZE, LSB }, MAP, PRINT_HEX \
}; \
@@ -70,7 +71,8 @@ #define REG(SIZE, LSB, BANK) \
#define MAPPED_REG(SIZE, LSB, BANK, MAP) \
{ \
- typedef char static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \
+ typedef char ATTRIBUTE_UNUSED \
+ static_assert[(1 << (SIZE)) == ARRAY_SIZE (MAP)]; \
static const struct mips_reg_operand op = { \
{ OP_REG, SIZE, LSB }, OP_REG_##BANK, MAP \
}; \
@@ -79,8 +81,10 @@ #define MAPPED_REG(SIZE, LSB, BANK, MAP)
#define REG_PAIR(SIZE, LSB, BANK, MAP) \
{ \
- typedef char static_assert1[(1 << (SIZE)) == ARRAY_SIZE (MAP##1)]; \
- typedef char static_assert2[(1 << (SIZE)) == ARRAY_SIZE (MAP##2)]; \
+ typedef char ATTRIBUTE_UNUSED \
+ static_assert1[(1 << (SIZE)) == ARRAY_SIZE (MAP##1)]; \
+ typedef char ATTRIBUTE_UNUSED \
+ static_assert2[(1 << (SIZE)) == ARRAY_SIZE (MAP##2)]; \
static const struct mips_reg_pair_operand op = { \
{ OP_REG_PAIR, SIZE, LSB }, OP_REG_##BANK, MAP##1, MAP##2 \
}; \