This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [buildbot] gas/config/tc-mips.c r1.579: error: signed and unsigned type in conditional expression
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: Jan-Benedict Glaw <jbglaw at lug-owl dot de>
- Cc: JÃrgen Urban <JuergenUrban at gmx dot de>, binutils at sourceware dot org
- Date: Mon, 05 Aug 2013 09:31:49 +0100
- Subject: Re: [buildbot] gas/config/tc-mips.c r1.579: error: signed and unsigned type in conditional expression
- References: <20130804213740 dot GO31990 at lug-owl dot de>
Jan-Benedict Glaw <jbglaw@lug-owl.de> writes:
> The recent R5900 / VU0 gave us a new error:
>
> [...]
> gcc -DHAVE_CONFIG_H -I. -I../../../../binutils/gas -I. -I../../../../binutils/gas -I../bfd -I../../../../binutils/gas/config -I../../../../binutils/gas/../include -I../../../../binutils/gas/.. -I../../../../binutils/gas/../bfd -DLOCALEDIR="\"/home/vaxbuild/_install_/mips64el-linux/share/locale\"" -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Werror -g -O2 -MT tc-mips.o -MD -MP -MF .deps/tc-mips.Tpo -c -o tc-mips.o `test -f 'config/tc-mips.c' || echo '../../../../binutils/gas/'`config/tc-mips.c
> ../../../../binutils/gas/config/tc-mips.c: In function âmips_lookup_insnâ:
> ../../../../binutils/gas/config/tc-mips.c:12351:40: error: signed and unsigned type in conditional expression [-Werror=sign-compare]
> opend = dot != NULL ? dot - name : length;
> ^
> cc1: all warnings being treated as errors
Fixed as follows.
Richard
gas/
* config/tc-mips.c (mips_lookup_insn): Make length and opend signed.
Index: gas/config/tc-mips.c
===================================================================
--- gas/config/tc-mips.c 2013-08-05 09:27:21.164069975 +0100
+++ gas/config/tc-mips.c 2013-08-05 09:29:31.264367476 +0100
@@ -12307,11 +12307,11 @@ mips16_macro (struct mips_cl_insn *ip)
static struct mips_opcode *
mips_lookup_insn (struct hash_control *hash, const char *start,
- unsigned int length, unsigned int *opcode_extra)
+ ssize_t length, unsigned int *opcode_extra)
{
char *name, *dot, *p;
unsigned int mask, suffix;
- size_t opend;
+ ssize_t opend;
struct mips_opcode *insn;
/* Make a copy of the instruction so that we can fiddle with it. */