This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: [PATCH]: Fix compile time warning building ARM port of GAS
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Wed, 01 Jun 2005 02:42:19 -0700
- Subject: Re: [PATCH]: Fix compile time warning building ARM port of GAS
- References: <m3oeaq1obl.fsf@redhat.com>
Nick Clifton <nickc@redhat.com> writes:
> Hi Guys,
>
> I am applying the patch below to fix a compile time warning message
> which was preventing the ARM port of GAS being built. The warning
> message was:
>
> .../gas/config/tc-arm.c:8445: warning:
> the address of `do_t_it', will always evaluate as `true'
>
> (There were lots of duplicates of this message for different lines
> in the tc-arm.c source file). This was from a 3.4 based version of
> GCC.
>
> The problem was because of macros like this:
>
> #define TUE(mnem, op, top, nops, ops, ae, te) \
> { #mnem, OPS##nops ops, OT_unconditional, 0x##op, 0x##top, ARM_VARIANT, \
> do_##te ? THUMB_VARIANT : 0, do_##ae, do_##te }
>
> where the "do_##te ? THUMB_VARIANT : 0" always evaluates to
> THUMB_VARIANT since do_##te must always exist - it is used to
> initialise the last field in the structure being set up by the
> macro. Hence the patch just removes the redundant tests.
Sorry, that's not a redundant test. Look farther down the file, each
of the Txx macros has a corresponding non-T macro, that invokes the T
macro with 0 for the 'te' argument. Since md_assemble uses the
tvariant field to decide whether it's got an encoding function to
call, this patch will cause the assembler to crash on, e.g.
.text
.syntax unified
.thumb
rsc r0, r0, r0
I can work with you to find another solution, but I'm not seeing these
warnings. What compiler are you using?
zw