Patchwork GDB/opcodes: Remove arch/mach/endian disassembler assertions

login
register
mail settings
Submitter H.J. Lu
Date Aug. 7, 2017, 3:05 p.m.
Message ID <CAMe9rOoCG+pJ2aBfoT3SyYNj2TgiBz7xOhmMBrGbhpnac++gQQ@mail.gmail.com>
Download mbox | patch
Permalink /patch/21949/
State New
Headers show

Comments

H.J. Lu - Aug. 7, 2017, 3:05 p.m.
On Mon, Aug 7, 2017 at 7:56 AM, Maciej W. Rozycki <macro@imgtec.com> wrote:
> On Mon, 7 Aug 2017, Alan Modra wrote:
>
>> >     gdb/
>> >     * arch-utils.c (default_print_insn): Remove arch/mach/endian
>> >     assertions.
>> >
>> >     opcodes/
>> >     * disassemble.c (disassembler): Remove arch/mach/endian
>> >     assertions.
>>
>> This is OK, obvious really.
>
>  Applied now, thanks for your review.
>
>   Maciej

I am checking in:


to fix

/export/gnu/import/git/sources/binutils-gdb/opcodes/disassemble.c: In
function ‘disassembler’:
/export/gnu/import/git/sources/binutils-gdb/opcodes/disassemble.c:113:52:
error: unused parameter ‘big’ [-Werror=unused-parameter]
 disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
                                                    ^~~
/export/gnu/import/git/sources/binutils-gdb/opcodes/disassemble.c:113:71:
error: unused parameter ‘mach’ [-Werror=unused-parameter]
 disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
                                                                       ^~~~
cc1: all warnings being treated as errors
make[6]: *** [Makefile:1313: disassemble.lo] Error 1

on x86.
Maciej W. Rozycki - Aug. 7, 2017, 3:15 p.m.
On Mon, 7 Aug 2017, H.J. Lu wrote:

> I am checking in:
> 
> diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c
> index 0058354265..11206c67a5 100644
> --- a/opcodes/disassemble.c
> +++ b/opcodes/disassemble.c
> @@ -110,7 +110,9 @@
>  #endif
> 
>  disassembler_ftype
> -disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
> +disassembler (enum bfd_architecture a,
> +        bfd_boolean big ATTRIBUTE_UNUSED,
> +        unsigned long mach ATTRIBUTE_UNUSED,
>          bfd *abfd ATTRIBUTE_UNUSED)
>  {
>    disassembler_ftype disassemble;
> 
> to fix
> 
> /export/gnu/import/git/sources/binutils-gdb/opcodes/disassemble.c: In
> function ‘disassembler’:
> /export/gnu/import/git/sources/binutils-gdb/opcodes/disassemble.c:113:52:
> error: unused parameter ‘big’ [-Werror=unused-parameter]
>  disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
>                                                     ^~~
> /export/gnu/import/git/sources/binutils-gdb/opcodes/disassemble.c:113:71:
> error: unused parameter ‘mach’ [-Werror=unused-parameter]
>  disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
>                                                                        ^~~~
> cc1: all warnings being treated as errors
> make[6]: *** [Makefile:1313: disassemble.lo] Error 1
> 
> on x86.

 Thanks, and sorry for the breakage.  I only verified it with 
`--enable-targets=all', but should have run full binutils testing across 
my usual targets.

  Maciej

Patch

diff --git a/opcodes/disassemble.c b/opcodes/disassemble.c
index 0058354265..11206c67a5 100644
--- a/opcodes/disassemble.c
+++ b/opcodes/disassemble.c
@@ -110,7 +110,9 @@ 
 #endif

 disassembler_ftype
-disassembler (enum bfd_architecture a, bfd_boolean big, unsigned long mach,
+disassembler (enum bfd_architecture a,
+        bfd_boolean big ATTRIBUTE_UNUSED,
+        unsigned long mach ATTRIBUTE_UNUSED,
         bfd *abfd ATTRIBUTE_UNUSED)
 {
   disassembler_ftype disassemble;