Commit: PR 22823: Fix gcc 8 compile time warnings

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Commit: PR 22823: Fix gcc 8 compile time warnings

Nick Clifton
Hi Guys,

  I am applying the attached patch to fix the compile time warnings that
  are generated when compiling the binutils with gcc v8.0.1.  Almost all
  of them were about conflicts in the casts of function pointers to
  dummy functions.  To solve this I chose to create a set of extra dummy
  functions which accept a variable number of arguments.  Thus
  satisfying the compiler and allowing the build to finish.

Cheers
  Nick

bfd/ChangeLog
2018-02-13  Nick Clifton  <[hidden email]>

        PR 22823
        Fix compile time warnings generated by gcc version 8.
        * libbfd-in.h: Remove extraneous text from prototypes.
        Add prototypes for bfd_false_any, bfd_true_any,
        bfd_nullvoidptr_any, bfd_0_any, bfd_0u_any, bfd_0l_any,
        bfd_n1_any, bfd_void_any.
        (_bfd_generic_bfd_copy_private_bfd_data): Use vararg based dummy
        function.
        (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
        (_bfd_generic_bfd_set_private_flags): Likewise.
        (_bfd_generic_bfd_copy_private_section_data): Likewise.
        (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
        (_bfd_generic_bfd_copy_private_header_data): Likewise.
        (_bfd_generic_bfd_print_private_bfd_data): Likewise.
        (_bfd_noarchive_construct_extended_name_table): Likewise.
        (_bfd_noarchive_truncate_arname): Likewise.
        (_bfd_noarchive_write_ar_hdr): Likewise.
        (_bfd_noarchive_get_elt_at_index): Likewise.
        (_bfd_nosymbols_canonicalize_symtab): Likewise.
        (_bfd_nosymbols_print_symbol): Likewise.
        (_bfd_nosymbols_get_symbol_info): Likewise.
        (_bfd_nosymbols_get_symbol_version_string): Likewise.
        (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
        (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
        (_bfd_nosymbols_get_lineno): Likewise.
        (_bfd_nosymbols_find_nearest_line): Likewise.
        (_bfd_nosymbols_find_line): Likewise.
        (_bfd_nosymbols_find_inliner_info): Likewise.
        (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
        (_bfd_nosymbols_read_minisymbols): Likewise.
        (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
        (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
        (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
        (_bfd_nowrite_set_arch_mach): Likewise.
        (_bfd_nowrite_set_section_contents): Likewise.
        (_bfd_nolink_sizeof_headers): Likewise.
        (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
        (_bfd_nolink_bfd_relax_section): Likewise.
        (_bfd_nolink_bfd_gc_sections): Likewise.
        (_bfd_nolink_bfd_lookup_section_flags): Likewise.
        (_bfd_nolink_bfd_merge_sections): Likewise.
        (_bfd_nolink_bfd_is_group_section): Likewise.
        (_bfd_nolink_bfd_discard_group): Likewise.
        (_bfd_nolink_bfd_link_hash_table_create): Likewise.
        (_bfd_nolink_bfd_link_add_symbols): Likewise.
        (_bfd_nolink_bfd_link_just_syms): Likewise.
        (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
        (_bfd_nolink_bfd_final_link): Likewise.
        (_bfd_nolink_bfd_link_split_section): Likewise.
        (_bfd_nolink_section_already_linked): Likewise.
        (_bfd_nolink_bfd_define_common_symbol): Likewise.
        (_bfd_nolink_bfd_define_start_stop): Likewise.
        (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
        (_bfd_nodynamic_get_synthetic_symtab): Likewise.
        (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
        (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
        * libbfd.c (bfd_false_any): New function.  Like bfd_false but
        accepts one or more arguments.
        (bfd_true_any): Likewise.
        (bfd_nullvoidptr_any): Likewise.
        (bfd_0_any): Likewise.
        (bfd_0u_any): Likewise.
        (bfd_0l_any): Likewise.
        (_bfd_n1_any): Likewise.
        (bfd_void_any): Likewise.
        * libbfd.h (extern): Regenerate
        * aout-target.h (MY_bfd_is_target_special_symbol): Use vararg
        based dummy function.
        * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
        * binary.c (binary_get_symbol_info): Likewise.
        * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
        * coff-mips.c (mips_ecoff_backend_data): Likewise.
        * coffcode.h (coff_set_alignment_hook): Likewise.
        (symname_in_debug_hook): Likewise.
        (bfd_coff_backend_data bigobj_swap_table): Likewise.
        * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
        * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
        * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
        (bfd_elfNN_bfd_make_debug_symbol): Likewise.
        (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
        (bfd_elfNN_bfd_set_private_flags): Likewise.
        (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
        (elf_backend_init_index_section): Likewise.
        (elf_backend_allow_non_load_phdr): Likewise.
        * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
        * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
        * ieee.c (ieee_construct_extended_name_table): Likewise.
        (ieee_write_armap): Likewise.
        (ieee_write_ar_hdr): Likewise.
        (ieee_bfd_is_target_special_symbol): Likewise.
        * ihex.c (ihex_canonicalize_symtab): Likewise.
        (ihex_bfd_is_target_special_symbol): Likewise.
        * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
        * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
        (_bfd_ecoff_set_alignment_hook): Likewise.
        * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
        * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
        * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
        * oasys.c (oasys_construct_extended_name_table): Likewise.
        (oasys_write_armap): Likewise.
        (oasys_write_ar_hdr): Likewise.
        (oasys_bfd_is_target_special_symbol): Likewise.
        * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
        * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
        * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
        * som.c (som_bfd_is_target_special_symbol): Likewise.
        * srec.c (srec_bfd_is_target_special_symbol): Likewise.
        * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
        * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
        * versados.c (versados_bfd_is_target_special_symbol): Likewise.
        (versados_bfd_reloc_name_lookup): Likewise.
        * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
        (vms_bfd_define_start_stop): Likewise.
        (alpha_vms_bfd_is_target_special_symbol): Likewise.
        * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
        * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.
        * elf32-arc.c (get_replace_function): Assign replacement function
        to func pointer.
        * elf32-i370.c (i370_noop): Update prototype.

gas/ChangeLog
2018-02-13  Nick Clifton  <[hidden email]>

        PR 22823
        * config/obj-elf.c (elf_pseudo_table): Remove now redundant
        casts.
        (obj_elf_vtable_inherit): Rename to obj_elf_get_vtable_inherit.
        (obj_elf_vtable_inherit): New stub function that calls
        obj_elf_get_vtable_inherit.
        (obj_elf_vtable_entry): Rename to obj_elf_get_vtable_entry.
        (obj_elf_vtable_entry): New stub function that calls
        obj_elf_get_vtable_entry.
        * config/obj-elf.h (obj_elf_vtable_inherit): Update prototype.
        (obj_elf_vtable_entry) Likewise.
        (obj_elf_get_vtable_inherit) Likewise.
        (obj_elf_get_vtable_entry) Likewise.
        * config/tc-arm.c (md_pseudo_table): Remove now redundant cast.
        * config/tc-i386c (md_pseudo_table): Likewise.
        * config/tc-hppa.c (pa_vtable_entry): Call
        obj_elf_get_vtable_entry.
        (pa_vtable_inherit): Call obj_elf_get_vtable_inherit.
        * config/tc-mips.c (s_mips_file): Replace call to dwarf2_get_file
        with call to dwarf2_get_filename.
        * dwarf2dbg.c (dwarf2_directive_file): Rename to
        dwarf2_directive_filename.
        (dwarf2_directive_file): New stub function that calls
        dwarf2_directive_filename.
        * dwarf2dbg.h: Prototype dwarf2_directive_filename.

opcodes/ChangeLog
2018-02-13  Nick Clifton  <[hidden email]>

        PR 22823
        * metag-dis.c (print_fmmov): Double buffer size to avoid warning
        about truncation of printing.


pr22823.patch.2 (112K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Maciej W. Rozycki-2
Hi Nick,

>   I am applying the attached patch to fix the compile time warnings that
>   are generated when compiling the binutils with gcc v8.0.1.  Almost all
>   of them were about conflicts in the casts of function pointers to
>   dummy functions.  To solve this I chose to create a set of extra dummy
>   functions which accept a variable number of arguments.  Thus
>   satisfying the compiler and allowing the build to finish.

 Unfortunately this has broken LD severely, in a host rather than target
dependent manner I believe.  I can see it with the `x86_64-linux' host and
the `mips-linux' target as numerous segfaults throughout the LD test
suite.

 The thing is the new `bfd_false_any' function is a variable-argument one
and expects the argument count in $rax, as per the x86-64 psABI[1].  This
is how compiled code looks like:

Dump of assembler code for function bfd_false_any:
0x0000000000455119 <bfd_false_any+0>: push   %rbp
0x000000000045511a <bfd_false_any+1>: mov    %rsp,%rbp
0x000000000045511d <bfd_false_any+4>: sub    $0xc0,%rsp
0x0000000000455124 <bfd_false_any+11>: mov    %rsi,-0xa8(%rbp)
0x000000000045512b <bfd_false_any+18>: mov    %rdx,-0xa0(%rbp)
0x0000000000455132 <bfd_false_any+25>: mov    %rcx,-0x98(%rbp)
0x0000000000455139 <bfd_false_any+32>: mov    %r8,-0x90(%rbp)
0x0000000000455140 <bfd_false_any+39>: mov    %r9,-0x88(%rbp)
0x0000000000455147 <bfd_false_any+46>: movzbl %al,%eax
0x000000000045514a <bfd_false_any+49>: mov    %rax,-0xc0(%rbp)
0x0000000000455151 <bfd_false_any+56>: mov    -0xc0(%rbp),%rdx
0x0000000000455158 <bfd_false_any+63>: lea    0x0(,%rdx,4),%rax
0x0000000000455160 <bfd_false_any+71>: movq   $0x45519f,-0xc0(%rbp)
0x000000000045516b <bfd_false_any+82>: sub    %rax,-0xc0(%rbp)
0x0000000000455172 <bfd_false_any+89>: lea    -0x1(%rbp),%rax
0x0000000000455176 <bfd_false_any+93>: mov    -0xc0(%rbp),%rdx
0x000000000045517d <bfd_false_any+100>: jmpq   *%rdx
0x000000000045517f <bfd_false_any+102>: movaps %xmm7,-0xf(%rax)
0x0000000000455183 <bfd_false_any+106>: movaps %xmm6,-0x1f(%rax)
0x0000000000455187 <bfd_false_any+110>: movaps %xmm5,-0x2f(%rax)
0x000000000045518b <bfd_false_any+114>: movaps %xmm4,-0x3f(%rax)
0x000000000045518f <bfd_false_any+118>: movaps %xmm3,-0x4f(%rax)
0x0000000000455193 <bfd_false_any+122>: movaps %xmm2,-0x5f(%rax)
0x0000000000455197 <bfd_false_any+126>: movaps %xmm1,-0x6f(%rax)
0x000000000045519b <bfd_false_any+130>: movaps %xmm0,-0x7f(%rax)
0x000000000045519f <bfd_false_any+134>: mov    %rdi,-0xb8(%rbp)
0x00000000004551a6 <bfd_false_any+141>: mov    $0x5,%edi
0x00000000004551ab <bfd_false_any+146>: callq  0x44eda4 <bfd_set_error>
0x00000000004551b0 <bfd_false_any+151>: mov    $0x0,%eax
0x00000000004551b5 <bfd_false_any+156>: leaveq
0x00000000004551b6 <bfd_false_any+157>: retq  
End of assembler dump.

This code breaks when called as the handler for
`bed->elf_backend_allow_non_load_phdr' from elf.c:6141 in
`assign_file_positions_except_relocs'.

 The incoming value of $rax is 0x91d920, an outcome from earlier
operations and not set up for the call to `bfd_false_any'.  This gets
truncated to 0x20 at 0x455147, multiplied by 4 at 0x455158 and subtracted
from 0x45519f at 0x45516b, to calculate which of the 8 MOVAPS instructions
ending at 0x45519f to jump to at 0x45517d.  As 0x20 is above 8, this
calculation causes an overrun and as a result the jump is made to 0x45511f
to what is now interpreted as this instruction:

0x45511f <bfd_false_any+6>: in     (%dx),%al

which then segfaults.  This happens at `-O0'; perhaps the optimiser hides
the problem with optimisation enabled.

 For some host psABIs I suppose initialising a fixed-argument function
pointer with a variable-argument function reference and then using the
pointer to make a call is going to work, but this is UB AFAIK as per the C
language standard, so I suggest that you revert your change and look for a
better alternative, as the cure seems worse than the disease.

 NB I don't know where the idea of complaining about extraneous function
arguments has come from for GCC 8 (except maybe for `-pedantic'), as this
property of the C vs Pascal function calling convention has been relied on
since forever.

References:

[1] "System V Application Binary Interface AMD64 Architecture Processor
    Supplement", Draft Version 0.99.6, July 2, 2012, Section 3.5.7
    "Variable Argument Lists", p. 50

  Maciej
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Alan Modra-3
On Wed, Feb 14, 2018 at 02:59:34AM +0000, Maciej W. Rozycki wrote:

>  For some host psABIs I suppose initialising a fixed-argument function
> pointer with a variable-argument function reference and then using the
> pointer to make a call is going to work, but this is UB AFAIK as per the C
> language standard, so I suggest that you revert your change and look for a
> better alternative, as the cure seems worse than the disease.
>
>  NB I don't know where the idea of complaining about extraneous function
> arguments has come from for GCC 8 (except maybe for `-pedantic'), as this
> property of the C vs Pascal function calling convention has been relied on
> since forever.

Wow, what a horrible gcc warning.  A warning for casts from a function
taking no argument, but no warning for casts from a variadic to
non-variadic function!

--
Alan Modra
Australia Development Lab, IBM
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Nick Clifton
In reply to this post by Maciej W. Rozycki-2
Hi Maciej,

>>   dummy functions.  To solve this I chose to create a set of extra dummy
>>   functions which accept a variable number of arguments.  Thus
>>   satisfying the compiler and allowing the build to finish.
>
>  Unfortunately this has broken LD severely, in a host rather than target
> dependent manner I believe.

Yikes!  Sorry about that.  For some reason this problem does not show up
on my machine, even when compiling at -O0.  We must be using slightly
different versions of the compiler.

Please could you try out the attached patch and let me know if it solves
the problem ?

Cheers
  Nick

bfd_false.patch (673 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Maciej W. Rozycki-2
Hi Nick,

> >  Unfortunately this has broken LD severely, in a host rather than target
> > dependent manner I believe.
>
> Yikes!  Sorry about that.  For some reason this problem does not show up
> on my machine, even when compiling at -O0.  We must be using slightly
> different versions of the compiler.

 Undoubtedly, GCC 4.4.7 here.

> Please could you try out the attached patch and let me know if it solves
> the problem ?

 It does change code produced somewhat, by adding instructions between
last MOVAPS and the call to `bfd_set_error'.  The prologue is unchanged
however and hence the crash remains.  I wouldn't expect anything else,
because the UB observed is from the mismatch between the prototype and the
definition.

 Here's new disassembly for the record:

Dump of assembler code for function bfd_false_any:
0x0000000000455119 <bfd_false_any+0>: push   %rbp
0x000000000045511a <bfd_false_any+1>: mov    %rsp,%rbp
0x000000000045511d <bfd_false_any+4>: sub    $0xe0,%rsp
0x0000000000455124 <bfd_false_any+11>: mov    %rsi,-0xa8(%rbp)
0x000000000045512b <bfd_false_any+18>: mov    %rdx,-0xa0(%rbp)
0x0000000000455132 <bfd_false_any+25>: mov    %rcx,-0x98(%rbp)
0x0000000000455139 <bfd_false_any+32>: mov    %r8,-0x90(%rbp)
0x0000000000455140 <bfd_false_any+39>: mov    %r9,-0x88(%rbp)
0x0000000000455147 <bfd_false_any+46>: movzbl %al,%eax
0x000000000045514a <bfd_false_any+49>: mov    %rax,-0xe0(%rbp)
0x0000000000455151 <bfd_false_any+56>: mov    -0xe0(%rbp),%rdx
0x0000000000455158 <bfd_false_any+63>: lea    0x0(,%rdx,4),%rax
0x0000000000455160 <bfd_false_any+71>: movq   $0x45519f,-0xe0(%rbp)
0x000000000045516b <bfd_false_any+82>: sub    %rax,-0xe0(%rbp)
0x0000000000455172 <bfd_false_any+89>: lea    -0x1(%rbp),%rax
0x0000000000455176 <bfd_false_any+93>: mov    -0xe0(%rbp),%rdx
0x000000000045517d <bfd_false_any+100>: jmpq   *%rdx
0x000000000045517f <bfd_false_any+102>: movaps %xmm7,-0xf(%rax)
0x0000000000455183 <bfd_false_any+106>: movaps %xmm6,-0x1f(%rax)
0x0000000000455187 <bfd_false_any+110>: movaps %xmm5,-0x2f(%rax)
0x000000000045518b <bfd_false_any+114>: movaps %xmm4,-0x3f(%rax)
0x000000000045518f <bfd_false_any+118>: movaps %xmm3,-0x4f(%rax)
0x0000000000455193 <bfd_false_any+122>: movaps %xmm2,-0x5f(%rax)
0x0000000000455197 <bfd_false_any+126>: movaps %xmm1,-0x6f(%rax)
0x000000000045519b <bfd_false_any+130>: movaps %xmm0,-0x7f(%rax)
0x000000000045519f <bfd_false_any+134>: mov    %rdi,-0xd8(%rbp)
0x00000000004551a6 <bfd_false_any+141>: lea    -0xd0(%rbp),%rax
0x00000000004551ad <bfd_false_any+148>: movl   $0x8,(%rax)
0x00000000004551b3 <bfd_false_any+154>: lea    -0xd0(%rbp),%rax
0x00000000004551ba <bfd_false_any+161>: movl   $0x30,0x4(%rax)
0x00000000004551c1 <bfd_false_any+168>: lea    -0xd0(%rbp),%rax
0x00000000004551c8 <bfd_false_any+175>: lea    0x10(%rbp),%rdx
0x00000000004551cc <bfd_false_any+179>: mov    %rdx,0x8(%rax)
0x00000000004551d0 <bfd_false_any+183>: lea    -0xd0(%rbp),%rax
0x00000000004551d7 <bfd_false_any+190>: lea    -0xb0(%rbp),%rdx
0x00000000004551de <bfd_false_any+197>: mov    %rdx,0x10(%rax)
0x00000000004551e2 <bfd_false_any+201>: mov    $0x5,%edi
0x00000000004551e7 <bfd_false_any+206>: callq  0x44eda4 <bfd_set_error>
0x00000000004551ec <bfd_false_any+211>: mov    $0x0,%eax
0x00000000004551f1 <bfd_false_any+216>: leaveq
0x00000000004551f2 <bfd_false_any+217>: retq  
End of assembler dump.

 Perhaps GCC 8 would be kind enough to shut up if you made a non-prototype
declaration of `bfd_false' as follows:

extern bfd_boolean bfd_false ();

and then reverted to using `bfd_false' where you changed it to
`bfd_false_any'.  

 Unfortunately someone was clever enough to require parameter type lists
to unconditionally match for two function types to be compatible, ruling
out traditional use:

"For two function types to be compatible, both shall specify compatible
return types.  Moreover, the parameter type lists, if both are present,
shall agree in the number of parameters and in use of the ellipsis
terminator; corresponding parameters shall have compatible types. [...]"

so the warning appears legitimate to me although (as Alan observed) it
fails to trip on an ellipsis mismatch.

References:

[1] "Programming languages -- C", ISO/IEC 9899:201x, N1570 Committee Draft
    -- April 12, 2011, Paragraph 6.7.6.3 "Function declarators (including
    prototypes)", clause 15, p. 133

  Maciej
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Nick Clifton
Hi Maciej,

>> Please could you try out the attached patch and let me know if it solves
>> the problem ?
>
>  It does change code produced somewhat, by adding instructions between
> last MOVAPS and the call to `bfd_set_error'.  The prologue is unchanged
> however and hence the crash remains.

Fine.  I think that it is obvious that I chose the wrong approach to solving
the warning message problem.  So I have reverted my previous patch, and
instead I have found a solution using non-prototyped casts, similar to your
suggestion.  So for example:

  #define _bfd_noarchive_write_ar_hdr \
    ((bfd_boolean (*) (bfd *, bfd *)) bfd_false)

Now becomes:

  #define _bfd_noarchive_write_ar_hdr \
    ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_false)

This satisfies gcc v8, and I am really hoping that it will not break gcc v4...

Full patch attached.

Cheers
  Nick

bfd/ChangeLog
2018-02-14  Nick Clifton  <[hidden email]>

        PR 22823
        Revert previous delta.  Add extra casts to avoid compile time
        warnings instead.
        * libbfd-in.h (_bfd_generic_bfd_copy_private_bfd_data): Add extra
        cast to avoid warning from gcc v8 compiler.
        (_bfd_generic_bfd_merge_private_bfd_data): Likewise.
        (_bfd_generic_bfd_set_private_flags): Likewise.
        (_bfd_generic_bfd_copy_private_section_data): Likewise.
        (_bfd_generic_bfd_copy_private_symbol_data): Likewise.
        (_bfd_generic_bfd_copy_private_header_data): Likewise.
        (_bfd_generic_bfd_print_private_bfd_data): Likewise.
        (_bfd_noarchive_construct_extended_name_table): Likewise.
        (_bfd_noarchive_truncate_arname): Likewise.
        (_bfd_noarchive_write_ar_hdr): Likewise.
        (_bfd_noarchive_get_elt_at_index): Likewise.
        (_bfd_nosymbols_canonicalize_symtab): Likewise.
        (_bfd_nosymbols_print_symbol): Likewise.
        (_bfd_nosymbols_get_symbol_info): Likewise.
        (_bfd_nosymbols_get_symbol_version_string): Likewise.
        (_bfd_nosymbols_bfd_is_local_label_name): Likewise.
        (_bfd_nosymbols_bfd_is_target_special_symbol): Likewise.
        (_bfd_nosymbols_get_lineno): Likewise.
        (_bfd_nosymbols_find_nearest_line): Likewise.
        (_bfd_nosymbols_find_line): Likewise.
        (_bfd_nosymbols_find_inliner_info): Likewise.
        (_bfd_nosymbols_bfd_make_debug_symbol): Likewise.
        (_bfd_nosymbols_read_minisymbols): Likewise.
        (_bfd_nosymbols_minisymbol_to_symbol): Likewise.
        (_bfd_norelocs_bfd_reloc_type_lookup): Likewise.
        (_bfd_norelocs_bfd_reloc_name_lookup): Likewise.
        (_bfd_nowrite_set_arch_mach): Likewise.
        (_bfd_nowrite_set_section_contents): Likewise.
        (_bfd_nolink_sizeof_headers): Likewise.
        (_bfd_nolink_bfd_get_relocated_section_contents): Likewise.
        (_bfd_nolink_bfd_relax_section): Likewise.
        (_bfd_nolink_bfd_gc_sections): Likewise.
        (_bfd_nolink_bfd_lookup_section_flags): Likewise.
        (_bfd_nolink_bfd_merge_sections): Likewise.
        (_bfd_nolink_bfd_is_group_section): Likewise.
        (_bfd_nolink_bfd_discard_group): Likewise.
        (_bfd_nolink_bfd_link_hash_table_create): Likewise.
        (_bfd_nolink_bfd_link_add_symbols): Likewise.
        (_bfd_nolink_bfd_link_just_syms): Likewise.
        (_bfd_nolink_bfd_copy_link_hash_symbol_type): Likewise.
        (_bfd_nolink_bfd_final_link): Likewise.
        (_bfd_nolink_bfd_link_split_section): Likewise.
        (_bfd_nolink_section_already_linked): Likewise.
        (_bfd_nolink_bfd_define_common_symbol): Likewise.
        (_bfd_nolink_bfd_define_start_stop): Likewise.
        (_bfd_nodynamic_canonicalize_dynamic_symtab): Likewise.
        (_bfd_nodynamic_get_synthetic_symtab): Likewise.
        (_bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_): Likewise.
        (_bfd_nodynamic_canonicalize_dynamic_reloc): Likewise.
        * libbfd.c (bfd_false_any): Delete.
        (bfd_true_any, bfd_nullvoidptr_any, bfd_0_any): Delete.
        (bfd_0u_any, bfd_0l_any, _bfd_n1_any, bfd_void_any): Delete.
        * libbfd.h (extern): Regenerate
        * aout-target.h (MY_bfd_is_target_special_symbol): Add extra
        cast to avoid warning from gcc v8 compiler.
        * aout-tic30.c (tic30_aout_set_arch_mach): Likewise.
        * binary.c (binary_get_symbol_info): Likewise.
        * coff-alpha.c (alpha_ecoff_backend_data): Likewise.
        * coff-mips.c (mips_ecoff_backend_data): Likewise.
        * coffcode.h (coff_set_alignment_hook): Likewise.
        (symname_in_debug_hook): Likewise.
        (bfd_coff_backend_data bigobj_swap_table): Likewise.
        * elf-m10300.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-cr16.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-lm32.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-m32r.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-metag.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-score.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-score7.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-xstormy16.c (elf_backend_omit_section_dynsym): Likewise.
        * elf32-xtensa.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-alpha.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-hppa.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-ia64-vms.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-mmix.c (elf_backend_omit_section_dynsym): Likewise.
        * elf64-sh64.c (elf_backend_omit_section_dynsym): Likewise.
        * elfnn-ia64.c (elf_backend_omit_section_dynsym): Likewise.
        * elfxx-target.h (bfd_elfNN_bfd_debug_info_accumulate): Likewise.
        (bfd_elfNN_bfd_make_debug_symbol): Likewise.
        (bfd_elfNN_bfd_merge_private_bfd_data): Likewise.
        (bfd_elfNN_bfd_set_private_flags): Likewise.
        (bfd_elfNN_bfd_is_target_special_symbol): Likewise.
        (elf_backend_init_index_section): Likewise.
        (elf_backend_allow_non_load_phdr): Likewise.
        * elfxx-x86.h (elf_backend_omit_section_dynsym): Likewise.
        * i386msdos.c (msdos_bfd_is_target_special_symbol): Likewise.
        * ieee.c (ieee_construct_extended_name_table): Likewise.
        (ieee_write_armap): Likewise.
        (ieee_write_ar_hdr): Likewise.
        (ieee_bfd_is_target_special_symbol): Likewise.
        * ihex.c (ihex_canonicalize_symtab): Likewise.
        (ihex_bfd_is_target_special_symbol): Likewise.
        * libaout.h (aout_32_bfd_is_target_special_symbol): Likewise.
        * libecoff.h (_bfd_ecoff_bfd_is_target_special_symbol): Likewise.
        (_bfd_ecoff_set_alignment_hook): Likewise.
        * mach-o-target.c (bfd_mach_o_bfd_is_target_special_symbol): Likewise.
        * mmo.c (mmo_bfd_is_target_special_symbol): Likewise.
        * nlm-target.h (nlm_bfd_is_target_special_symbol): Likewise.
        * oasys.c (oasys_construct_extended_name_table): Likewise.
        (oasys_write_armap): Likewise.
        (oasys_write_ar_hdr): Likewise.
        (oasys_bfd_is_target_special_symbol): Likewise.
        * pef.c (bfd_pef_bfd_is_target_special_symbol): Likewise.
        * plugin.c (bfd_plugin_bfd_is_target_special_symbol): Likewise.
        * ppcboot.c (ppcboot_bfd_is_target_special_symbol): Likewise.
        * som.c (som_bfd_is_target_special_symbol): Likewise.
        * srec.c (srec_bfd_is_target_special_symbol): Likewise.
        * tekhex.c (tekhex_bfd_is_target_special_symbol): Likewise.
        * verilog.c (verilog_bfd_is_target_special_symbol): Likewise.
        * versados.c (versados_bfd_is_target_special_symbol): Likewise.
        (versados_bfd_reloc_name_lookup): Likewise.
        * vms-alpha.c (vms_bfd_is_target_special_symbol): Likewise.
        (vms_bfd_define_start_stop): Likewise.
        (alpha_vms_bfd_is_target_special_symbol): Likewise.
        * wasm-module.c (wasm_bfd_is_target_special_symbol): Likewise.
        * xsym.c (bfd_sym_bfd_is_target_special_symbol): Likewise.


pr22823.patch.3 (63K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Andreas Schwab
On Feb 14 2018, Nick Clifton <[hidden email]> wrote:

> Now becomes:
>
>   #define _bfd_noarchive_write_ar_hdr \
>     ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_false)

'bfd_boolean (*)' is not a function type.

Andreas.

--
Andreas Schwab, SUSE Labs, [hidden email]
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Maciej W. Rozycki-2
On Wed, 14 Feb 2018, Andreas Schwab wrote:

> > Now becomes:
> >
> >   #define _bfd_noarchive_write_ar_hdr \
> >     ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_false)
>
> 'bfd_boolean (*)' is not a function type.

 Updating that to:

#define _bfd_noarchive_write_ar_hdr \
  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*) ()) bfd_false)

yields:

warning: function declaration isn't a prototype

however (we have `-Wstrict-prototypes' spelled out explicitly).  It looks
like casting to `void (*) (void)' is the way to calm GCC, according to
`-Wcast-function-type' option documentation (if all else fails, check the
manual).

 This update on top of Nick's patch works for me.  NB we may want to
reformat code affected once we've settled on the final version as there
are many overlong lines here.

  Maciej

---
 bfd/aout-target.h     |    2 -
 bfd/aout-tic30.c      |    2 -
 bfd/binary.c          |    2 -
 bfd/coff-alpha.c      |   14 +++----
 bfd/coff-mips.c       |   14 +++----
 bfd/coffcode.h        |    6 +--
 bfd/elf-m10300.c      |    2 -
 bfd/elf32-cr16.c      |    2 -
 bfd/elf32-lm32.c      |    2 -
 bfd/elf32-m32r.c      |    2 -
 bfd/elf32-metag.c     |    2 -
 bfd/elf32-score.c     |    2 -
 bfd/elf32-score7.c    |    2 -
 bfd/elf32-xstormy16.c |    2 -
 bfd/elf32-xtensa.c    |    2 -
 bfd/elf64-alpha.c     |    2 -
 bfd/elf64-hppa.c      |    2 -
 bfd/elf64-ia64-vms.c  |    2 -
 bfd/elf64-mmix.c      |    2 -
 bfd/elf64-sh64.c      |    2 -
 bfd/elfnn-ia64.c      |    2 -
 bfd/elfxx-target.h    |   14 +++----
 bfd/elfxx-x86.h       |    2 -
 bfd/i386msdos.c       |    2 -
 bfd/ieee.c            |    8 ++--
 bfd/ihex.c            |    4 +-
 bfd/libaout.h         |    2 -
 bfd/libbfd-in.h       |  100 +++++++++++++++++++++++++-------------------------
 bfd/libbfd.h          |  100 +++++++++++++++++++++++++-------------------------
 bfd/libecoff.h        |    4 +-
 bfd/mach-o-target.c   |    2 -
 bfd/mmo.c             |    2 -
 bfd/nlm-target.h      |    2 -
 bfd/oasys.c           |    8 ++--
 bfd/pef.c             |    2 -
 bfd/plugin.c          |    2 -
 bfd/ppcboot.c         |    2 -
 bfd/som.c             |    2 -
 bfd/srec.c            |    2 -
 bfd/tekhex.c          |    2 -
 bfd/verilog.c         |    2 -
 bfd/versados.c        |    2 -
 bfd/vms-alpha.c       |    4 +-
 bfd/wasm-module.c     |    2 -
 bfd/xsym.c            |    2 -
 45 files changed, 172 insertions(+), 172 deletions(-)

binutils-bfd-pr22823-fix.diff
Index: binutils/bfd/aout-target.h
===================================================================
--- binutils.orig/bfd/aout-target.h 2018-02-15 08:07:30.755598182 +0000
+++ binutils/bfd/aout-target.h 2018-02-15 08:10:49.704313356 +0000
@@ -581,7 +581,7 @@ MY_bfd_final_link (bfd *abfd, struct bfd
 #endif
 
 #ifndef MY_bfd_is_target_special_symbol
-#define MY_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define MY_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #endif
 
 #ifndef MY_bfd_free_cached_info
Index: binutils/bfd/aout-tic30.c
===================================================================
--- binutils.orig/bfd/aout-tic30.c 2018-02-15 08:07:30.780893981 +0000
+++ binutils/bfd/aout-tic30.c 2018-02-15 08:10:49.717382055 +0000
@@ -1037,7 +1037,7 @@ tic30_aout_set_arch_mach (bfd *abfd,
 
 #ifndef MY_bfd_is_target_special_symbol
 #define MY_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #endif
 
 #ifndef MY_bfd_free_cached_info
Index: binutils/bfd/binary.c
===================================================================
--- binutils.orig/bfd/binary.c 2018-02-15 08:07:30.799061792 +0000
+++ binutils/bfd/binary.c 2018-02-15 08:10:49.736459119 +0000
@@ -211,7 +211,7 @@ binary_get_symbol_info (bfd *ignore_abfd
 #define binary_bfd_make_debug_symbol   _bfd_nosymbols_bfd_make_debug_symbol
 #define binary_read_minisymbols   _bfd_generic_read_minisymbols
 #define binary_minisymbol_to_symbol   _bfd_generic_minisymbol_to_symbol
-#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define binary_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 
 /* Set the architecture of a binary file.  */
 #define binary_set_arch_mach _bfd_generic_set_arch_mach
Index: binutils/bfd/coff-alpha.c
===================================================================
--- binutils.orig/bfd/coff-alpha.c 2018-02-15 08:07:30.820361719 +0000
+++ binutils/bfd/coff-alpha.c 2018-02-15 08:10:49.750514437 +0000
@@ -2226,13 +2226,13 @@ static const struct ecoff_backend_data a
 {
   /* COFF backend structure.  */
   {
-    (void (*) (bfd *, void *, int, int, int, int, void *)) (void (*)) bfd_void, /* aux_in */
-    (void (*) (bfd *, void *, void *)) (void (*)) bfd_void, /* sym_in */
-    (void (*) (bfd *, void *, void *)) (void (*)) bfd_void, /* lineno_in */
-    (unsigned (*) (bfd *, void *, int, int, int, int, void *)) (unsigned (*)) bfd_0u,/*aux_out*/
-    (unsigned (*) (bfd *, void *, void *)) (unsigned (*)) bfd_0u, /* sym_out */
-    (unsigned (*) (bfd *, void *, void *)) (unsigned (*)) bfd_0u, /* lineno_out */
-    (unsigned (*) (bfd *, void *, void *)) (unsigned (*)) bfd_0u, /* reloc_out */
+    (void (*) (bfd *, void *, int, int, int, int, void *)) (void (*) (void)) bfd_void, /* aux_in */
+    (void (*) (bfd *, void *, void *)) (void (*) (void)) bfd_void, /* sym_in */
+    (void (*) (bfd *, void *, void *)) (void (*) (void)) bfd_void, /* lineno_in */
+    (unsigned (*) (bfd *, void *, int, int, int, int, void *)) (void (*) (void)) bfd_0u,/*aux_out*/
+    (unsigned (*) (bfd *, void *, void *)) (void (*) (void)) bfd_0u, /* sym_out */
+    (unsigned (*) (bfd *, void *, void *)) (void (*) (void)) bfd_0u, /* lineno_out */
+    (unsigned (*) (bfd *, void *, void *)) (void (*) (void)) bfd_0u, /* reloc_out */
     alpha_ecoff_swap_filehdr_out, alpha_ecoff_swap_aouthdr_out,
     alpha_ecoff_swap_scnhdr_out,
     FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE,
Index: binutils/bfd/coff-mips.c
===================================================================
--- binutils.orig/bfd/coff-mips.c 2018-02-15 08:07:30.833582493 +0000
+++ binutils/bfd/coff-mips.c 2018-02-15 08:10:49.765559259 +0000
@@ -1244,13 +1244,13 @@ static const struct ecoff_backend_data m
 {
   /* COFF backend structure.  */
   {
-    (void (*) (bfd *,void *,int,int,int,int,void *)) (void (*)) bfd_void, /* aux_in */
-    (void (*) (bfd *,void *,void *)) (void (*)) bfd_void, /* sym_in */
-    (void (*) (bfd *,void *,void *)) (void (*)) bfd_void, /* lineno_in */
-    (unsigned (*) (bfd *,void *,int,int,int,int,void *)) (unsigned (*)) bfd_0u,/*aux_out*/
-    (unsigned (*) (bfd *,void *,void *)) (unsigned (*)) bfd_0u, /* sym_out */
-    (unsigned (*) (bfd *,void *,void *)) (unsigned (*)) bfd_0u, /* lineno_out */
-    (unsigned (*) (bfd *,void *,void *)) (unsigned (*)) bfd_0u, /* reloc_out */
+    (void (*) (bfd *,void *,int,int,int,int,void *)) (void (*) (void)) bfd_void, /* aux_in */
+    (void (*) (bfd *,void *,void *)) (void (*) (void)) bfd_void, /* sym_in */
+    (void (*) (bfd *,void *,void *)) (void (*) (void)) bfd_void, /* lineno_in */
+    (unsigned (*) (bfd *,void *,int,int,int,int,void *)) (void (*) (void)) bfd_0u,/*aux_out*/
+    (unsigned (*) (bfd *,void *,void *)) (void (*) (void)) bfd_0u, /* sym_out */
+    (unsigned (*) (bfd *,void *,void *)) (void (*) (void)) bfd_0u, /* lineno_out */
+    (unsigned (*) (bfd *,void *,void *)) (void (*) (void)) bfd_0u, /* reloc_out */
     mips_ecoff_swap_filehdr_out, mips_ecoff_swap_aouthdr_out,
     mips_ecoff_swap_scnhdr_out,
     FILHSZ, AOUTSZ, SCNHSZ, 0, 0, 0, 0, FILNMLEN, TRUE,
Index: binutils/bfd/coffcode.h
===================================================================
--- binutils.orig/bfd/coffcode.h 2018-02-15 08:07:30.841643795 +0000
+++ binutils/bfd/coffcode.h 2018-02-15 08:10:49.782624990 +0000
@@ -1986,7 +1986,7 @@ coff_set_alignment_hook (bfd *abfd, asec
 #else /* ! RS6000COFF_C */
 
 #define coff_set_alignment_hook \
-  ((void (*) (bfd *, asection *, void *)) (void (*)) bfd_void)
+  ((void (*) (bfd *, asection *, void *)) (void (*) (void)) bfd_void)
 
 #endif /* ! RS6000COFF_C */
 #endif /* ! COFF_WITH_PE */
@@ -2508,7 +2508,7 @@ symname_in_debug_hook (bfd * abfd ATTRIB
 #else
 
 #define symname_in_debug_hook \
-  (bfd_boolean (*) (bfd *, struct internal_syment *)) (bfd_boolean (*)) bfd_false
+  (bfd_boolean (*) (bfd *, struct internal_syment *)) (void (*) (void)) bfd_false
 
 #endif
 
@@ -6024,7 +6024,7 @@ static bfd_coff_backend_data bigobj_swap
 #endif
 
 #ifndef coff_bfd_is_target_special_symbol
-#define coff_bfd_is_target_special_symbol   ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define coff_bfd_is_target_special_symbol   ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #endif
 
 #ifndef coff_read_minisymbols
Index: binutils/bfd/elf-m10300.c
===================================================================
--- binutils.orig/bfd/elf-m10300.c 2018-02-15 08:07:30.862863078 +0000
+++ binutils/bfd/elf-m10300.c 2018-02-15 08:10:49.829776997 +0000
@@ -5575,7 +5575,7 @@ mn10300_elf_mkobject (bfd *abfd)
 #define elf_backend_size_dynamic_sections \
   _bfd_mn10300_elf_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_finish_dynamic_symbol \
   _bfd_mn10300_elf_finish_dynamic_symbol
 #define elf_backend_finish_dynamic_sections \
Index: binutils/bfd/elf32-cr16.c
===================================================================
--- binutils.orig/bfd/elf32-cr16.c 2018-02-15 08:07:30.875984445 +0000
+++ binutils/bfd/elf32-cr16.c 2018-02-15 08:10:49.849828552 +0000
@@ -2922,7 +2922,7 @@ _bfd_cr16_elf_reloc_type_class (const st
 #define elf_backend_size_dynamic_sections \
   _bfd_cr16_elf_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-      ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+      ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_finish_dynamic_symbol \
    _bfd_cr16_elf_finish_dynamic_symbol
 #define elf_backend_finish_dynamic_sections \
Index: binutils/bfd/elf32-lm32.c
===================================================================
--- binutils.orig/bfd/elf32-lm32.c 2018-02-15 08:07:30.893114920 +0000
+++ binutils/bfd/elf32-lm32.c 2018-02-15 08:10:49.869910984 +0000
@@ -2581,7 +2581,7 @@ lm32_elf_fdpic_copy_private_bfd_data (bf
 #define elf_backend_copy_indirect_symbol lm32_elf_copy_indirect_symbol
 #define elf_backend_size_dynamic_sections lm32_elf_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_create_dynamic_sections lm32_elf_create_dynamic_sections
 #define elf_backend_finish_dynamic_sections lm32_elf_finish_dynamic_sections
 #define elf_backend_adjust_dynamic_symbol lm32_elf_adjust_dynamic_symbol
Index: binutils/bfd/elf32-m32r.c
===================================================================
--- binutils.orig/bfd/elf32-m32r.c 2018-02-15 08:07:30.906236333 +0000
+++ binutils/bfd/elf32-m32r.c 2018-02-15 08:10:49.888030440 +0000
@@ -3855,7 +3855,7 @@ m32r_elf_reloc_type_class (const struct
 #define bfd_elf32_bfd_link_hash_table_create m32r_elf_link_hash_table_create
 #define elf_backend_size_dynamic_sections m32r_elf_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_finish_dynamic_sections m32r_elf_finish_dynamic_sections
 #define elf_backend_adjust_dynamic_symbol m32r_elf_adjust_dynamic_symbol
 #define elf_backend_finish_dynamic_symbol m32r_elf_finish_dynamic_symbol
Index: binutils/bfd/elf32-metag.c
===================================================================
--- binutils.orig/bfd/elf32-metag.c 2018-02-15 08:07:30.930400312 +0000
+++ binutils/bfd/elf32-metag.c 2018-02-15 08:10:49.902114193 +0000
@@ -4141,7 +4141,7 @@ elf_metag_plt_sym_val (bfd_vma i, const
 #define elf_backend_finish_dynamic_sections elf_metag_finish_dynamic_sections
 #define elf_backend_size_dynamic_sections elf_metag_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_post_process_headers elf_metag_post_process_headers
 #define elf_backend_reloc_type_class elf_metag_reloc_type_class
 #define elf_backend_copy_indirect_symbol elf_metag_copy_indirect_symbol
Index: binutils/bfd/elf32-score.c
===================================================================
--- binutils.orig/bfd/elf32-score.c 2018-02-15 08:07:30.941482216 +0000
+++ binutils/bfd/elf32-score.c 2018-02-15 08:10:49.917188921 +0000
@@ -4467,7 +4467,7 @@ _bfd_score_elf_common_definition (Elf_In
 #define elf_backend_size_dynamic_sections \
   _bfd_score_elf_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_create_dynamic_sections \
   _bfd_score_elf_create_dynamic_sections
 #define elf_backend_finish_dynamic_symbol \
Index: binutils/bfd/elf32-score7.c
===================================================================
--- binutils.orig/bfd/elf32-score7.c 2018-02-15 08:07:30.952595516 +0000
+++ binutils/bfd/elf32-score7.c 2018-02-15 08:10:49.928264477 +0000
@@ -3872,4 +3872,4 @@ s7_elf32_score_new_section_hook (bfd *ab
 }
 
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
Index: binutils/bfd/elf32-xstormy16.c
===================================================================
--- binutils.orig/bfd/elf32-xstormy16.c 2018-02-15 08:07:30.978903931 +0000
+++ binutils/bfd/elf32-xstormy16.c 2018-02-15 08:10:49.945345738 +0000
@@ -1009,7 +1009,7 @@ xstormy16_elf_gc_mark_hook (asection *se
 #define elf_backend_always_size_sections \
   xstormy16_elf_always_size_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_finish_dynamic_sections \
   xstormy16_elf_finish_dynamic_sections
 
Index: binutils/bfd/elf32-xtensa.c
===================================================================
--- binutils.orig/bfd/elf32-xtensa.c 2018-02-15 08:07:30.997345906 +0000
+++ binutils/bfd/elf32-xtensa.c 2018-02-15 08:10:49.965417300 +0000
@@ -11244,7 +11244,7 @@ static const struct bfd_elf_special_sect
 #define elf_backend_size_dynamic_sections    elf_xtensa_size_dynamic_sections
 #define elf_backend_always_size_sections     elf_xtensa_always_size_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_special_sections     elf_xtensa_special_sections
 #define elf_backend_action_discarded     elf_xtensa_action_discarded
 #define elf_backend_copy_indirect_symbol     elf_xtensa_copy_indirect_symbol
Index: binutils/bfd/elf64-alpha.c
===================================================================
--- binutils.orig/bfd/elf64-alpha.c 2018-02-15 08:07:31.032581374 +0000
+++ binutils/bfd/elf64-alpha.c 2018-02-15 08:10:49.985533872 +0000
@@ -5495,7 +5495,7 @@ static const struct elf_size_info alpha_
 #define elf_backend_size_dynamic_sections \
   elf64_alpha_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_relocate_section \
   elf64_alpha_relocate_section
 #define elf_backend_finish_dynamic_symbol \
Index: binutils/bfd/elf64-hppa.c
===================================================================
--- binutils.orig/bfd/elf64-hppa.c 2018-02-15 08:07:31.047688622 +0000
+++ binutils/bfd/elf64-hppa.c 2018-02-15 08:10:50.002650111 +0000
@@ -4053,7 +4053,7 @@ const struct elf_size_info hppa64_elf_si
 #define elf_backend_post_process_headers elf64_hppa_post_process_headers
 
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_adjust_dynamic_symbol \
  elf64_hppa_adjust_dynamic_symbol
 
Index: binutils/bfd/elf64-ia64-vms.c
===================================================================
--- binutils.orig/bfd/elf64-ia64-vms.c 2018-02-15 08:07:31.068822221 +0000
+++ binutils/bfd/elf64-ia64-vms.c 2018-02-15 08:10:50.011722258 +0000
@@ -5481,7 +5481,7 @@ static const struct elf_size_info elf64_
 #define elf_backend_size_dynamic_sections \
  elf64_ia64_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_relocate_section \
  elf64_ia64_relocate_section
 #define elf_backend_finish_dynamic_symbol \
Index: binutils/bfd/elf64-mmix.c
===================================================================
--- binutils.orig/bfd/elf64-mmix.c 2018-02-15 08:07:31.076873665 +0000
+++ binutils/bfd/elf64-mmix.c 2018-02-15 08:10:50.017756358 +0000
@@ -2902,7 +2902,7 @@ mmix_elf_relax_section (bfd *abfd,
 #define elf_backend_check_relocs mmix_elf_check_relocs
 #define elf_backend_symbol_processing mmix_elf_symbol_processing
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 
 #define bfd_elf64_bfd_copy_link_hash_symbol_type \
   _bfd_generic_copy_link_hash_symbol_type
Index: binutils/bfd/elf64-sh64.c
===================================================================
--- binutils.orig/bfd/elf64-sh64.c 2018-02-15 08:07:31.101031348 +0000
+++ binutils/bfd/elf64-sh64.c 2018-02-15 08:10:50.028809220 +0000
@@ -3927,7 +3927,7 @@ static const struct bfd_elf_special_sect
 #define elf_backend_size_dynamic_sections \
  sh64_elf64_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_finish_dynamic_symbol \
  sh64_elf64_finish_dynamic_symbol
 #define elf_backend_finish_dynamic_sections \
Index: binutils/bfd/elfnn-ia64.c
===================================================================
--- binutils.orig/bfd/elfnn-ia64.c 2018-02-15 08:07:31.117122145 +0000
+++ binutils/bfd/elfnn-ia64.c 2018-02-15 08:10:50.043870176 +0000
@@ -5046,7 +5046,7 @@ elfNN_hpux_backend_symbol_processing (bf
 #define elf_backend_size_dynamic_sections \
  elfNN_ia64_size_dynamic_sections
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_relocate_section \
  elfNN_ia64_relocate_section
 #define elf_backend_finish_dynamic_symbol \
Index: binutils/bfd/elfxx-target.h
===================================================================
--- binutils.orig/bfd/elfxx-target.h 2018-02-15 08:07:31.131265015 +0000
+++ binutils/bfd/elfxx-target.h 2018-02-15 08:10:50.051904884 +0000
@@ -148,7 +148,7 @@
 #define bfd_elfNN_bfd_debug_info_start bfd_void
 #define bfd_elfNN_bfd_debug_info_end bfd_void
 #define bfd_elfNN_bfd_debug_info_accumulate \
-  ((void (*) (bfd*, struct bfd_section *)) (void (*)) bfd_void)
+  ((void (*) (bfd*, struct bfd_section *)) (void (*) (void)) bfd_void)
 
 #ifndef bfd_elfNN_bfd_get_relocated_section_contents
 #define bfd_elfNN_bfd_get_relocated_section_contents \
@@ -212,7 +212,7 @@
 
 #ifndef bfd_elfNN_bfd_make_debug_symbol
 #define bfd_elfNN_bfd_make_debug_symbol \
-  ((asymbol * (*) (bfd *, void *, unsigned long)) (asymbol * (*)) bfd_nullvoidptr)
+  ((asymbol * (*) (bfd *, void *, unsigned long)) (void (*) (void)) bfd_nullvoidptr)
 #endif
 
 #ifndef bfd_elfNN_bfd_copy_private_symbol_data
@@ -238,18 +238,18 @@
 #endif
 #ifndef bfd_elfNN_bfd_merge_private_bfd_data
 #define bfd_elfNN_bfd_merge_private_bfd_data \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) (void (*) (void)) bfd_true)
 #endif
 #ifndef bfd_elfNN_bfd_set_private_flags
 #define bfd_elfNN_bfd_set_private_flags \
-  ((bfd_boolean (*) (bfd *, flagword)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, flagword)) (void (*) (void)) bfd_true)
 #endif
 #ifndef bfd_elfNN_bfd_is_local_label_name
 #define bfd_elfNN_bfd_is_local_label_name _bfd_elf_is_local_label_name
 #endif
 #ifndef bfd_elfNN_bfd_is_target_special_symbol
 #define bfd_elfNN_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #endif
 
 #ifndef bfd_elfNN_get_dynamic_reloc_upper_bound
@@ -474,7 +474,7 @@
 #endif
 #ifndef elf_backend_init_index_section
 #define elf_backend_init_index_section \
-  ((void (*) (bfd *, struct bfd_link_info *)) (void (*)) bfd_void)
+  ((void (*) (bfd *, struct bfd_link_info *)) (void (*) (void)) bfd_void)
 #endif
 #ifndef elf_backend_relocate_section
 #define elf_backend_relocate_section 0
@@ -502,7 +502,7 @@
 #endif
 #ifndef elf_backend_allow_non_load_phdr
 #define elf_backend_allow_non_load_phdr \
-  ((bfd_boolean (*) (bfd *, const Elf_Internal_Phdr *, unsigned)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, const Elf_Internal_Phdr *, unsigned)) (void (*) (void)) bfd_false)
 #endif
 #ifndef elf_backend_ecoff_debug_swap
 #define elf_backend_ecoff_debug_swap 0
Index: binutils/bfd/elfxx-x86.h
===================================================================
--- binutils.orig/bfd/elfxx-x86.h 2018-02-15 08:07:31.149431731 +0000
+++ binutils/bfd/elfxx-x86.h 2018-02-15 08:10:50.069993819 +0000
@@ -692,7 +692,7 @@ extern bfd * _bfd_x86_elf_link_setup_gnu
 #define elf_backend_gc_mark_hook \
   _bfd_x86_elf_gc_mark_hook
 #define elf_backend_omit_section_dynsym \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *, asection *)) (void (*) (void)) bfd_true)
 #define elf_backend_parse_gnu_properties \
   _bfd_x86_elf_parse_gnu_properties
 #define elf_backend_merge_gnu_properties \
Index: binutils/bfd/i386msdos.c
===================================================================
--- binutils.orig/bfd/i386msdos.c 2018-02-15 08:07:31.161514760 +0000
+++ binutils/bfd/i386msdos.c 2018-02-15 08:10:50.075013049 +0000
@@ -251,7 +251,7 @@ msdos_set_section_contents (bfd *abfd,
 #define msdos_find_line _bfd_nosymbols_find_line
 #define msdos_find_inliner_info _bfd_nosymbols_find_inliner_info
 #define msdos_get_lineno _bfd_nosymbols_get_lineno
-#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define msdos_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define msdos_bfd_is_local_label_name _bfd_nosymbols_bfd_is_local_label_name
 #define msdos_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define msdos_read_minisymbols _bfd_nosymbols_read_minisymbols
Index: binutils/bfd/ieee.c
===================================================================
--- binutils.orig/bfd/ieee.c 2018-02-15 08:07:31.182672868 +0000
+++ binutils/bfd/ieee.c 2018-02-15 08:10:50.083064852 +0000
@@ -3858,22 +3858,22 @@ ieee_sizeof_headers (bfd *abfd ATTRIBUTE
 #define ieee_construct_extended_name_table \
   ((bfd_boolean (*) \
     (bfd *, char **, bfd_size_type *, const char **)) \
-   (bfd_boolean (*)) bfd_true)
+   (void (*) (void)) bfd_true)
 #define ieee_truncate_arname bfd_dont_truncate_arname
 #define ieee_write_armap \
   ((bfd_boolean (*) \
     (bfd *, unsigned int, struct orl *, unsigned int, int)) \
-   (bfd_boolean (*)) bfd_true)
+   (void (*) (void)) bfd_true)
 #define ieee_read_ar_hdr bfd_nullvoidptr
 #define ieee_write_ar_hdr \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_false)
 #define ieee_update_armap_timestamp bfd_true
 #define ieee_get_elt_at_index _bfd_generic_get_elt_at_index
 
 #define ieee_get_symbol_version_string \
   _bfd_nosymbols_get_symbol_version_string
 #define ieee_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define ieee_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define ieee_get_lineno _bfd_nosymbols_get_lineno
 #define ieee_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
Index: binutils/bfd/ihex.c
===================================================================
--- binutils.orig/bfd/ihex.c 2018-02-15 08:07:31.191792717 +0000
+++ binutils/bfd/ihex.c 2018-02-15 08:10:50.095123370 +0000
@@ -919,12 +919,12 @@ ihex_sizeof_headers (bfd *abfd ATTRIBUTE
 #define ihex_new_section_hook  _bfd_generic_new_section_hook
 #define ihex_get_section_contents_in_window  _bfd_generic_get_section_contents_in_window
 #define ihex_get_symtab_upper_bound  bfd_0l
-#define ihex_canonicalize_symtab  ((long (*) (bfd *, asymbol **)) (long (*)) bfd_0l)
+#define ihex_canonicalize_symtab  ((long (*) (bfd *, asymbol **)) (void (*) (void)) bfd_0l)
 #define ihex_make_empty_symbol  _bfd_generic_make_empty_symbol
 #define ihex_print_symbol  _bfd_nosymbols_print_symbol
 #define ihex_get_symbol_info  _bfd_nosymbols_get_symbol_info
 #define ihex_get_symbol_version_string  _bfd_nosymbols_get_symbol_version_string
-#define ihex_bfd_is_target_special_symbol  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define ihex_bfd_is_target_special_symbol  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define ihex_bfd_is_local_label_name  _bfd_nosymbols_bfd_is_local_label_name
 #define ihex_get_lineno  _bfd_nosymbols_get_lineno
 #define ihex_find_nearest_line  _bfd_nosymbols_find_nearest_line
Index: binutils/bfd/libaout.h
===================================================================
--- binutils.orig/bfd/libaout.h 2018-02-15 08:07:31.204922876 +0000
+++ binutils/bfd/libaout.h 2018-02-15 08:10:50.107206315 +0000
@@ -618,7 +618,7 @@ extern bfd_boolean NAME (aout, bfd_free_
 
 #ifndef aout_32_bfd_is_target_special_symbol
 #define aout_32_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #endif
 
 #ifndef WRITE_HEADERS
Index: binutils/bfd/libbfd-in.h
===================================================================
--- binutils.orig/bfd/libbfd-in.h 2018-02-15 08:07:31.222145763 +0000
+++ binutils/bfd/libbfd-in.h 2018-02-15 08:10:50.127317469 +0000
@@ -258,19 +258,19 @@ extern bfd_boolean _bfd_generic_get_sect
    BFD_JUMP_TABLE_COPY (_bfd_generic).  */
 
 #define _bfd_generic_bfd_copy_private_bfd_data \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_merge_private_bfd_data \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_set_private_flags \
-  ((bfd_boolean (*) (bfd *, flagword)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, flagword)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_copy_private_section_data \
-  ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_copy_private_symbol_data \
-  ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_copy_private_header_data \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_print_private_bfd_data \
-  ((bfd_boolean (*) (bfd *, void *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, void *)) (void (*) (void)) bfd_true)
 
 extern bfd_boolean _bfd_generic_init_private_section_data
   (bfd *, asection *, bfd *, asection *, struct bfd_link_info *);
@@ -294,19 +294,19 @@ extern int _bfd_nocore_core_file_pid
 #define _bfd_noarchive_slurp_extended_name_table bfd_false
 #define _bfd_noarchive_construct_extended_name_table \
   ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_noarchive_truncate_arname \
-  ((void (*) (bfd *, const char *, char *)) (void (*)) bfd_void)
+  ((void (*) (bfd *, const char *, char *)) (void (*) (void)) bfd_void)
 #define _bfd_noarchive_write_armap \
   ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr
 #define _bfd_noarchive_write_ar_hdr \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_false)
 #define _bfd_noarchive_openr_next_archived_file \
-  ((bfd * (*) (bfd *, bfd *)) (bfd * (*)) bfd_nullvoidptr)
+  ((bfd * (*) (bfd *, bfd *)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_noarchive_get_elt_at_index \
-  ((bfd * (*) (bfd *, symindex)) (bfd * (*)) bfd_nullvoidptr)
+  ((bfd * (*) (bfd *, symindex)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
 #define _bfd_noarchive_update_armap_timestamp bfd_false
 
@@ -402,41 +402,41 @@ extern bfd_boolean _bfd_vms_lib_ia64_mka
 
 #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
 #define _bfd_nosymbols_canonicalize_symtab \
-  ((long (*) (bfd *, asymbol **)) (long (*)) _bfd_n1)
+  ((long (*) (bfd *, asymbol **)) (void (*) (void)) _bfd_n1)
 #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
 #define _bfd_nosymbols_print_symbol \
-  ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) (void (*)) bfd_void)
+  ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) (void (*) (void)) bfd_void)
 #define _bfd_nosymbols_get_symbol_info \
-  ((void (*) (bfd *, asymbol *, symbol_info *)) (void (*)) bfd_void)
+  ((void (*) (bfd *, asymbol *, symbol_info *)) (void (*) (void)) bfd_void)
 #define _bfd_nosymbols_get_symbol_version_string \
-  ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) (const char * (*)) bfd_nullvoidptr)
+  ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nosymbols_bfd_is_local_label_name \
-  ((bfd_boolean (*) (bfd *, const char *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, const char *)) (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_get_lineno \
-  ((alent *(*) (bfd *, asymbol *)) (alent * (*)) bfd_nullvoidptr)
+  ((alent *(*) (bfd *, asymbol *)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nosymbols_find_nearest_line \
   ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \
      const char **, const char **, unsigned int *, \
      unsigned int *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_find_line \
   ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \
      const char **, unsigned int *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_find_inliner_info \
   ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_bfd_make_debug_symbol \
   ((asymbol * (*) (bfd *, void *, unsigned long)) \
-   (asymbol * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nosymbols_read_minisymbols \
   ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) \
-   (long (*)) _bfd_n1)
+   (void (*) (void)) _bfd_n1)
 #define _bfd_nosymbols_minisymbol_to_symbol \
   ((asymbol * (*) (bfd *, bfd_boolean, const void *, asymbol *)) \
-   (asymbol * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 
 /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc
    support.  Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs).  */
@@ -448,20 +448,20 @@ extern void _bfd_norelocs_set_reloc (bfd
      arelent **, unsigned int);
 #define _bfd_norelocs_bfd_reloc_type_lookup \
   ((reloc_howto_type * (*) (bfd *, bfd_reloc_code_real_type)) \
-   (reloc_howto_type * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_norelocs_bfd_reloc_name_lookup \
   ((reloc_howto_type * (*) (bfd *, const char *)) \
-   (reloc_howto_type * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 
 /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
    be written.  Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite).  */
 
 #define _bfd_nowrite_set_arch_mach \
   ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nowrite_set_section_contents \
   ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 
 /* Generic routines to use for BFD_JUMP_TABLE_WRITE.  Use
    BFD_JUMP_TABLE_WRITE (_bfd_generic).  */
@@ -474,60 +474,60 @@ extern bfd_boolean _bfd_generic_set_sect
    support linking.  Use BFD_JUMP_TABLE_LINK (_bfd_nolink).  */
 
 #define _bfd_nolink_sizeof_headers \
-  ((int (*) (bfd *, struct bfd_link_info *)) (int (*)) bfd_0)
+  ((int (*) (bfd *, struct bfd_link_info *)) (void (*) (void)) bfd_0)
 #define _bfd_nolink_bfd_get_relocated_section_contents \
   ((bfd_byte * (*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \
    bfd_byte *, bfd_boolean, asymbol **)) \
-   (bfd_byte * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nolink_bfd_relax_section \
   ((bfd_boolean (*) \
     (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_gc_sections \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_lookup_section_flags \
   ((bfd_boolean (*) (struct bfd_link_info *, struct flag_info *, asection *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_merge_sections \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_is_group_section \
   ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_discard_group \
   ((bfd_boolean (*) (bfd *, struct bfd_section *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_link_hash_table_create \
   ((struct bfd_link_hash_table * (*) (bfd *)) \
-   (struct bfd_link_hash_table * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nolink_bfd_link_add_symbols \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_link_just_syms \
   ((void (*) (asection *, struct bfd_link_info *)) \
-   (void (*)) bfd_void)
+   (void (*) (void)) bfd_void)
 #define _bfd_nolink_bfd_copy_link_hash_symbol_type \
   ((void (*) (bfd *, struct bfd_link_hash_entry *, \
       struct bfd_link_hash_entry *)) \
-   (void (*)) bfd_void)
+   (void (*) (void)) bfd_void)
 #define _bfd_nolink_bfd_final_link \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_link_split_section \
   ((bfd_boolean (*) (bfd *, struct bfd_section *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_section_already_linked \
   ((bfd_boolean (*) (bfd *, asection *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_define_common_symbol \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \
      struct bfd_link_hash_entry *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_define_start_stop \
   ((struct bfd_link_hash_entry * (*) (struct bfd_link_info *, \
       const char *, asection *)) \
-   (struct bfd_link_hash_entry * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nolink_bfd_link_check_relocs \
   _bfd_generic_link_check_relocs
 
@@ -537,13 +537,13 @@ extern bfd_boolean _bfd_generic_set_sect
 
 #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_symtab \
-  ((long (*) (bfd *, asymbol **)) (long (*)) _bfd_n1)
+  ((long (*) (bfd *, asymbol **)) (void (*) (void)) _bfd_n1)
 #define _bfd_nodynamic_get_synthetic_symtab \
   ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) \
-   (long (*)) _bfd_n1)
+   (void (*) (void)) _bfd_n1)
 #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_reloc \
-  ((long (*) (bfd *, arelent **, asymbol **)) (long (*)) _bfd_n1)
+  ((long (*) (bfd *, arelent **, asymbol **)) (void (*) (void)) _bfd_n1)
 
 /* Generic routine to determine of the given symbol is a local
    label.  */
Index: binutils/bfd/libbfd.h
===================================================================
--- binutils.orig/bfd/libbfd.h 2018-02-15 08:07:31.238362575 +0000
+++ binutils/bfd/libbfd.h 2018-02-15 08:10:50.170586881 +0000
@@ -263,19 +263,19 @@ extern bfd_boolean _bfd_generic_get_sect
    BFD_JUMP_TABLE_COPY (_bfd_generic).  */
 
 #define _bfd_generic_bfd_copy_private_bfd_data \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_merge_private_bfd_data \
-  ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_set_private_flags \
-  ((bfd_boolean (*) (bfd *, flagword)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, flagword)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_copy_private_section_data \
-  ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, asection *, bfd *, asection *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_copy_private_symbol_data \
-  ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, asymbol *, bfd *, asymbol *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_copy_private_header_data \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_true)
 #define _bfd_generic_bfd_print_private_bfd_data \
-  ((bfd_boolean (*) (bfd *, void *)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, void *)) (void (*) (void)) bfd_true)
 
 extern bfd_boolean _bfd_generic_init_private_section_data
   (bfd *, asection *, bfd *, asection *, struct bfd_link_info *);
@@ -299,19 +299,19 @@ extern int _bfd_nocore_core_file_pid
 #define _bfd_noarchive_slurp_extended_name_table bfd_false
 #define _bfd_noarchive_construct_extended_name_table \
   ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_noarchive_truncate_arname \
-  ((void (*) (bfd *, const char *, char *)) (void (*)) bfd_void)
+  ((void (*) (bfd *, const char *, char *)) (void (*) (void)) bfd_void)
 #define _bfd_noarchive_write_armap \
   ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_noarchive_read_ar_hdr bfd_nullvoidptr
 #define _bfd_noarchive_write_ar_hdr \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_false)
 #define _bfd_noarchive_openr_next_archived_file \
-  ((bfd * (*) (bfd *, bfd *)) (bfd * (*)) bfd_nullvoidptr)
+  ((bfd * (*) (bfd *, bfd *)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_noarchive_get_elt_at_index \
-  ((bfd * (*) (bfd *, symindex)) (bfd * (*)) bfd_nullvoidptr)
+  ((bfd * (*) (bfd *, symindex)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_noarchive_generic_stat_arch_elt bfd_generic_stat_arch_elt
 #define _bfd_noarchive_update_armap_timestamp bfd_false
 
@@ -407,41 +407,41 @@ extern bfd_boolean _bfd_vms_lib_ia64_mka
 
 #define _bfd_nosymbols_get_symtab_upper_bound _bfd_n1
 #define _bfd_nosymbols_canonicalize_symtab \
-  ((long (*) (bfd *, asymbol **)) (long (*)) _bfd_n1)
+  ((long (*) (bfd *, asymbol **)) (void (*) (void)) _bfd_n1)
 #define _bfd_nosymbols_make_empty_symbol _bfd_generic_make_empty_symbol
 #define _bfd_nosymbols_print_symbol \
-  ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) (void (*)) bfd_void)
+  ((void (*) (bfd *, void *, asymbol *, bfd_print_symbol_type)) (void (*) (void)) bfd_void)
 #define _bfd_nosymbols_get_symbol_info \
-  ((void (*) (bfd *, asymbol *, symbol_info *)) (void (*)) bfd_void)
+  ((void (*) (bfd *, asymbol *, symbol_info *)) (void (*) (void)) bfd_void)
 #define _bfd_nosymbols_get_symbol_version_string \
-  ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) (const char * (*)) bfd_nullvoidptr)
+  ((const char *(*) (bfd *, asymbol *, bfd_boolean *)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nosymbols_bfd_is_local_label_name \
-  ((bfd_boolean (*) (bfd *, const char *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, const char *)) (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_get_lineno \
-  ((alent *(*) (bfd *, asymbol *)) (alent * (*)) bfd_nullvoidptr)
+  ((alent *(*) (bfd *, asymbol *)) (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nosymbols_find_nearest_line \
   ((bfd_boolean (*) (bfd *, asymbol **, asection *, bfd_vma, \
      const char **, const char **, unsigned int *, \
      unsigned int *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_find_line \
   ((bfd_boolean (*) (bfd *, asymbol **, asymbol *, \
      const char **, unsigned int *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_find_inliner_info \
   ((bfd_boolean (*) (bfd *, const char **, const char **, unsigned int *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nosymbols_bfd_make_debug_symbol \
   ((asymbol * (*) (bfd *, void *, unsigned long)) \
-   (asymbol * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nosymbols_read_minisymbols \
   ((long (*) (bfd *, bfd_boolean, void **, unsigned int *)) \
-   (long (*)) _bfd_n1)
+   (void (*) (void)) _bfd_n1)
 #define _bfd_nosymbols_minisymbol_to_symbol \
   ((asymbol * (*) (bfd *, bfd_boolean, const void *, asymbol *)) \
-   (asymbol * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 
 /* Routines to use for BFD_JUMP_TABLE_RELOCS when there is no reloc
    support.  Use BFD_JUMP_TABLE_RELOCS (_bfd_norelocs).  */
@@ -453,20 +453,20 @@ extern void _bfd_norelocs_set_reloc (bfd
      arelent **, unsigned int);
 #define _bfd_norelocs_bfd_reloc_type_lookup \
   ((reloc_howto_type * (*) (bfd *, bfd_reloc_code_real_type)) \
-   (reloc_howto_type * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_norelocs_bfd_reloc_name_lookup \
   ((reloc_howto_type * (*) (bfd *, const char *)) \
-   (reloc_howto_type * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 
 /* Routines to use for BFD_JUMP_TABLE_WRITE for targets which may not
    be written.  Use BFD_JUMP_TABLE_WRITE (_bfd_nowrite).  */
 
 #define _bfd_nowrite_set_arch_mach \
   ((bfd_boolean (*) (bfd *, enum bfd_architecture, unsigned long)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nowrite_set_section_contents \
   ((bfd_boolean (*) (bfd *, asection *, const void *, file_ptr, bfd_size_type)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 
 /* Generic routines to use for BFD_JUMP_TABLE_WRITE.  Use
    BFD_JUMP_TABLE_WRITE (_bfd_generic).  */
@@ -479,60 +479,60 @@ extern bfd_boolean _bfd_generic_set_sect
    support linking.  Use BFD_JUMP_TABLE_LINK (_bfd_nolink).  */
 
 #define _bfd_nolink_sizeof_headers \
-  ((int (*) (bfd *, struct bfd_link_info *)) (int (*)) bfd_0)
+  ((int (*) (bfd *, struct bfd_link_info *)) (void (*) (void)) bfd_0)
 #define _bfd_nolink_bfd_get_relocated_section_contents \
   ((bfd_byte * (*) (bfd *, struct bfd_link_info *, struct bfd_link_order *, \
    bfd_byte *, bfd_boolean, asymbol **)) \
-   (bfd_byte * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nolink_bfd_relax_section \
   ((bfd_boolean (*) \
     (bfd *, asection *, struct bfd_link_info *, bfd_boolean *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_gc_sections \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_lookup_section_flags \
   ((bfd_boolean (*) (struct bfd_link_info *, struct flag_info *, asection *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_merge_sections \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_is_group_section \
   ((bfd_boolean (*) (bfd *, const struct bfd_section *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_discard_group \
   ((bfd_boolean (*) (bfd *, struct bfd_section *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_link_hash_table_create \
   ((struct bfd_link_hash_table * (*) (bfd *)) \
-   (struct bfd_link_hash_table * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nolink_bfd_link_add_symbols \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_link_just_syms \
   ((void (*) (asection *, struct bfd_link_info *)) \
-   (void (*)) bfd_void)
+   (void (*) (void)) bfd_void)
 #define _bfd_nolink_bfd_copy_link_hash_symbol_type \
   ((void (*) (bfd *, struct bfd_link_hash_entry *, \
       struct bfd_link_hash_entry *)) \
-   (void (*)) bfd_void)
+   (void (*) (void)) bfd_void)
 #define _bfd_nolink_bfd_final_link \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_link_split_section \
   ((bfd_boolean (*) (bfd *, struct bfd_section *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_section_already_linked \
   ((bfd_boolean (*) (bfd *, asection *, struct bfd_link_info *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_define_common_symbol \
   ((bfd_boolean (*) (bfd *, struct bfd_link_info *, \
      struct bfd_link_hash_entry *)) \
-   (bfd_boolean (*)) bfd_false)
+   (void (*) (void)) bfd_false)
 #define _bfd_nolink_bfd_define_start_stop \
   ((struct bfd_link_hash_entry * (*) (struct bfd_link_info *, \
       const char *, asection *)) \
-   (struct bfd_link_hash_entry * (*)) bfd_nullvoidptr)
+   (void (*) (void)) bfd_nullvoidptr)
 #define _bfd_nolink_bfd_link_check_relocs \
   _bfd_generic_link_check_relocs
 
@@ -542,13 +542,13 @@ extern bfd_boolean _bfd_generic_set_sect
 
 #define _bfd_nodynamic_get_dynamic_symtab_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_symtab \
-  ((long (*) (bfd *, asymbol **)) (long (*)) _bfd_n1)
+  ((long (*) (bfd *, asymbol **)) (void (*) (void)) _bfd_n1)
 #define _bfd_nodynamic_get_synthetic_symtab \
   ((long (*) (bfd *, long, asymbol **, long, asymbol **, asymbol **)) \
-   (long (*)) _bfd_n1)
+   (void (*) (void)) _bfd_n1)
 #define _bfd_nodynamic_get_dynamic_reloc_upper_bound _bfd_n1
 #define _bfd_nodynamic_canonicalize_dynamic_reloc \
-  ((long (*) (bfd *, arelent **, asymbol **)) (long (*)) _bfd_n1)
+  ((long (*) (bfd *, arelent **, asymbol **)) (void (*) (void)) _bfd_n1)
 
 /* Generic routine to determine of the given symbol is a local
    label.  */
Index: binutils/bfd/libecoff.h
===================================================================
--- binutils.orig/bfd/libecoff.h 2018-02-15 08:07:31.252496450 +0000
+++ binutils/bfd/libecoff.h 2018-02-15 08:10:50.181668820 +0000
@@ -277,7 +277,7 @@ extern bfd_boolean _bfd_ecoff_write_arma
 #define _bfd_ecoff_generic_stat_arch_elt bfd_generic_stat_arch_elt
 #define _bfd_ecoff_update_armap_timestamp bfd_true
 #define _bfd_ecoff_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 
 extern long _bfd_ecoff_get_symtab_upper_bound (bfd *);
 extern long _bfd_ecoff_canonicalize_symtab (bfd *, asymbol **);
@@ -327,7 +327,7 @@ extern bfd_boolean _bfd_ecoff_bfd_final_
 
 extern void * _bfd_ecoff_mkobject_hook (bfd *, void *, void *);
 #define _bfd_ecoff_set_alignment_hook \
-  ((void (*) (bfd *, asection *, void *)) (void (*)) bfd_void)
+  ((void (*) (bfd *, asection *, void *)) (void (*) (void)) bfd_void)
 extern bfd_boolean _bfd_ecoff_set_arch_mach_hook
   (bfd *, void *);
 extern bfd_boolean _bfd_ecoff_no_long_sections
Index: binutils/bfd/mach-o-target.c
===================================================================
--- binutils.orig/bfd/mach-o-target.c 2018-02-15 08:07:31.257542123 +0000
+++ binutils/bfd/mach-o-target.c 2018-02-15 08:10:50.193751280 +0000
@@ -27,7 +27,7 @@
 #define bfd_mach_o_bfd_free_cached_info      _bfd_generic_bfd_free_cached_info
 #define bfd_mach_o_get_section_contents_in_window     _bfd_generic_get_section_contents_in_window
 #define bfd_mach_o_bfd_print_private_bfd_data      _bfd_generic_bfd_print_private_bfd_data
-#define bfd_mach_o_bfd_is_target_special_symbol      ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define bfd_mach_o_bfd_is_target_special_symbol      ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define bfd_mach_o_bfd_is_local_label_name      bfd_generic_is_local_label_name
 #define bfd_mach_o_get_lineno      _bfd_nosymbols_get_lineno
 #define bfd_mach_o_find_inliner_info      _bfd_nosymbols_find_inliner_info
Index: binutils/bfd/mmo.c
===================================================================
--- binutils.orig/bfd/mmo.c 2018-02-15 08:07:31.267748240 +0000
+++ binutils/bfd/mmo.c 2018-02-15 08:10:50.208832260 +0000
@@ -3276,7 +3276,7 @@ mmo_write_object_contents (bfd *abfd)
    leading ':' might more appropriately be called local.  */
 #define mmo_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define mmo_bfd_is_target_special_symbol  \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 
 #define mmo_get_symbol_version_string \
   _bfd_nosymbols_get_symbol_version_string
Index: binutils/bfd/nlm-target.h
===================================================================
--- binutils.orig/bfd/nlm-target.h 2018-02-15 08:07:31.283889969 +0000
+++ binutils/bfd/nlm-target.h 2018-02-15 08:10:50.213851598 +0000
@@ -27,7 +27,7 @@
 #define nlm_get_symbol_info nlmNAME (get_symbol_info)
 #define nlm_get_symbol_version_string _bfd_nosymbols_get_symbol_version_string
 #define nlm_bfd_is_local_label_name bfd_generic_is_local_label_name
-#define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define nlm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define nlm_get_lineno _bfd_nosymbols_get_lineno
 #define nlm_find_nearest_line _bfd_nosymbols_find_nearest_line
 #define nlm_find_line _bfd_nosymbols_find_line
Index: binutils/bfd/oasys.c
===================================================================
--- binutils.orig/bfd/oasys.c 2018-02-15 08:07:31.299043421 +0000
+++ binutils/bfd/oasys.c 2018-02-15 08:10:50.221882998 +0000
@@ -1160,18 +1160,18 @@ oasys_sizeof_headers (bfd *abfd ATTRIBUT
 #define oasys_slurp_armap   bfd_true
 #define oasys_slurp_extended_name_table   bfd_true
 #define oasys_construct_extended_name_table   \
-  ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, char **, bfd_size_type *, const char **)) (void (*) (void)) bfd_true)
 #define oasys_truncate_arname   bfd_dont_truncate_arname
 #define oasys_write_armap   \
-  ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) (bfd_boolean (*)) bfd_true)
+  ((bfd_boolean (*) (bfd *, unsigned int, struct orl *, unsigned int, int)) (void (*) (void)) bfd_true)
 #define oasys_read_ar_hdr   bfd_nullvoidptr
 #define oasys_write_ar_hdr                         \
-  ((bfd_boolean (*) (bfd *, bfd *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, bfd *)) (void (*) (void)) bfd_false)
 #define oasys_get_elt_at_index   _bfd_generic_get_elt_at_index
 #define oasys_update_armap_timestamp   bfd_true
 #define oasys_bfd_is_local_label_name   bfd_generic_is_local_label_name
 #define oasys_bfd_is_target_special_symbol   \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define oasys_get_lineno   _bfd_nosymbols_get_lineno
 #define oasys_get_symbol_version_string   _bfd_nosymbols_get_symbol_version_string
 #define oasys_bfd_make_debug_symbol   _bfd_nosymbols_bfd_make_debug_symbol
Index: binutils/bfd/pef.c
===================================================================
--- binutils.orig/bfd/pef.c 2018-02-15 08:07:31.312153401 +0000
+++ binutils/bfd/pef.c 2018-02-15 08:10:50.238050807 +0000
@@ -39,7 +39,7 @@
 #define bfd_pef_new_section_hook    _bfd_generic_new_section_hook
 #define bfd_pef_bfd_is_local_label_name    bfd_generic_is_local_label_name
 #define bfd_pef_bfd_is_target_special_symbol        \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define bfd_pef_get_lineno    _bfd_nosymbols_get_lineno
 #define bfd_pef_find_nearest_line    _bfd_nosymbols_find_nearest_line
 #define bfd_pef_find_line    _bfd_nosymbols_find_line
Index: binutils/bfd/plugin.c
===================================================================
--- binutils.orig/bfd/plugin.c 2018-02-15 08:07:31.337360087 +0000
+++ binutils/bfd/plugin.c 2018-02-15 08:10:50.245100203 +0000
@@ -80,7 +80,7 @@ dlerror (void)
 #define bfd_plugin_bfd_set_private_flags      _bfd_generic_bfd_set_private_flags
 #define bfd_plugin_core_file_matches_executable_p     generic_core_file_matches_executable_p
 #define bfd_plugin_bfd_is_local_label_name      _bfd_nosymbols_bfd_is_local_label_name
-#define bfd_plugin_bfd_is_target_special_symbol      ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define bfd_plugin_bfd_is_target_special_symbol      ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define bfd_plugin_get_lineno      _bfd_nosymbols_get_lineno
 #define bfd_plugin_find_nearest_line      _bfd_nosymbols_find_nearest_line
 #define bfd_plugin_find_line      _bfd_nosymbols_find_line
Index: binutils/bfd/ppcboot.c
===================================================================
--- binutils.orig/bfd/ppcboot.c 2018-02-15 08:07:31.352465180 +0000
+++ binutils/bfd/ppcboot.c 2018-02-15 08:10:50.257195939 +0000
@@ -329,7 +329,7 @@ ppcboot_get_symbol_info (bfd *ignore_abf
 #define ppcboot_get_symbol_version_string \
   _bfd_nosymbols_get_symbol_version_string
 #define ppcboot_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define ppcboot_bfd_is_local_label_name bfd_generic_is_local_label_name
 #define ppcboot_get_lineno _bfd_nosymbols_get_lineno
 #define ppcboot_find_nearest_line _bfd_nosymbols_find_nearest_line
Index: binutils/bfd/som.c
===================================================================
--- binutils.orig/bfd/som.c 2018-02-15 08:07:31.376657154 +0000
+++ binutils/bfd/som.c 2018-02-15 08:10:50.279284084 +0000
@@ -6739,7 +6739,7 @@ som_bfd_link_split_section (bfd *abfd AT
 #define som_construct_extended_name_table _bfd_archive_coff_construct_extended_name_table
 #define som_update_armap_timestamp bfd_true
 #define som_bfd_is_target_special_symbol        \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define som_get_lineno _bfd_nosymbols_get_lineno
 #define som_bfd_make_debug_symbol _bfd_nosymbols_bfd_make_debug_symbol
 #define som_read_minisymbols _bfd_generic_read_minisymbols
Index: binutils/bfd/srec.c
===================================================================
--- binutils.orig/bfd/srec.c 2018-02-15 08:07:31.382725781 +0000
+++ binutils/bfd/srec.c 2018-02-15 08:10:50.291320611 +0000
@@ -1257,7 +1257,7 @@ srec_print_symbol (bfd *abfd,
 #define srec_close_and_cleanup  _bfd_generic_close_and_cleanup
 #define srec_bfd_free_cached_info  _bfd_generic_bfd_free_cached_info
 #define srec_new_section_hook  _bfd_generic_new_section_hook
-#define srec_bfd_is_target_special_symbol  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define srec_bfd_is_target_special_symbol  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define srec_bfd_is_local_label_name  bfd_generic_is_local_label_name
 #define srec_get_lineno  _bfd_nosymbols_get_lineno
 #define srec_find_nearest_line  _bfd_nosymbols_find_nearest_line
Index: binutils/bfd/tekhex.c
===================================================================
--- binutils.orig/bfd/tekhex.c 2018-02-15 08:07:31.398912676 +0000
+++ binutils/bfd/tekhex.c 2018-02-15 08:10:50.303353974 +0000
@@ -962,7 +962,7 @@ tekhex_print_symbol (bfd *abfd,
 #define tekhex_close_and_cleanup    _bfd_generic_close_and_cleanup
 #define tekhex_bfd_free_cached_info    _bfd_generic_bfd_free_cached_info
 #define tekhex_new_section_hook    _bfd_generic_new_section_hook
-#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define tekhex_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define tekhex_bfd_is_local_label_name     bfd_generic_is_local_label_name
 #define tekhex_get_lineno    _bfd_nosymbols_get_lineno
 #define tekhex_find_nearest_line    _bfd_nosymbols_find_nearest_line
Index: binutils/bfd/verilog.c
===================================================================
--- binutils.orig/bfd/verilog.c 2018-02-15 08:07:31.407014310 +0000
+++ binutils/bfd/verilog.c 2018-02-15 08:10:50.313392243 +0000
@@ -293,7 +293,7 @@ verilog_mkobject (bfd *abfd)
 #define verilog_close_and_cleanup     _bfd_generic_close_and_cleanup
 #define verilog_bfd_free_cached_info     _bfd_generic_bfd_free_cached_info
 #define verilog_new_section_hook     _bfd_generic_new_section_hook
-#define verilog_bfd_is_target_special_symbol     ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define verilog_bfd_is_target_special_symbol     ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define verilog_bfd_is_local_label_name     bfd_generic_is_local_label_name
 #define verilog_get_lineno     _bfd_nosymbols_get_lineno
 #define verilog_find_nearest_line     _bfd_nosymbols_find_nearest_line
Index: binutils/bfd/versados.c
===================================================================
--- binutils.orig/bfd/versados.c 2018-02-15 08:07:31.421158306 +0000
+++ binutils/bfd/versados.c 2018-02-15 08:10:50.325478095 +0000
@@ -849,7 +849,7 @@ versados_canonicalize_reloc (bfd *abfd,
 #define versados_bfd_free_cached_info      _bfd_generic_bfd_free_cached_info
 #define versados_new_section_hook      _bfd_generic_new_section_hook
 #define versados_bfd_is_target_special_symbol      \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define versados_bfd_is_local_label_name      bfd_generic_is_local_label_name
 #define versados_get_lineno      _bfd_nosymbols_get_lineno
 #define versados_find_nearest_line      _bfd_nosymbols_find_nearest_line
Index: binutils/bfd/vms-alpha.c
===================================================================
--- binutils.orig/bfd/vms-alpha.c 2018-02-15 08:07:31.434293969 +0000
+++ binutils/bfd/vms-alpha.c 2018-02-15 08:10:50.339524195 +0000
@@ -9490,7 +9490,7 @@ bfd_vms_get_data (bfd *abfd)
 }
 
 #define vms_bfd_is_target_special_symbol \
-  ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+  ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define vms_bfd_link_just_syms  _bfd_generic_link_just_syms
 #define vms_bfd_copy_link_hash_symbol_type \
   _bfd_generic_copy_link_hash_symbol_type
@@ -9511,7 +9511,7 @@ bfd_vms_get_data (bfd *abfd)
 /* Symbols table.  */
 #define alpha_vms_make_empty_symbol   _bfd_generic_make_empty_symbol
 #define alpha_vms_bfd_is_target_special_symbol \
-   ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+   ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define alpha_vms_print_symbol   vms_print_symbol
 #define alpha_vms_get_symbol_info   vms_get_symbol_info
 #define alpha_vms_get_symbol_version_string \
Index: binutils/bfd/wasm-module.c
===================================================================
--- binutils.orig/bfd/wasm-module.c 2018-02-15 08:07:31.443384839 +0000
+++ binutils/bfd/wasm-module.c 2018-02-15 08:10:50.350555309 +0000
@@ -773,7 +773,7 @@ wasm_object_p (bfd *abfd)
 /* BFD_JUMP_TABLE_SYMBOLS */
 #define wasm_get_symbol_version_string  _bfd_nosymbols_get_symbol_version_string
 #define wasm_bfd_is_local_label_name   bfd_generic_is_local_label_name
-#define wasm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define wasm_bfd_is_target_special_symbol ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define wasm_get_lineno  _bfd_nosymbols_get_lineno
 #define wasm_find_nearest_line  _bfd_nosymbols_find_nearest_line
 #define wasm_find_line  _bfd_nosymbols_find_line
Index: binutils/bfd/xsym.c
===================================================================
--- binutils.orig/bfd/xsym.c 2018-02-15 08:07:31.451492588 +0000
+++ binutils/bfd/xsym.c 2018-02-15 08:10:50.385651517 +0000
@@ -30,7 +30,7 @@
 #define bfd_sym_bfd_free_cached_info    _bfd_generic_bfd_free_cached_info
 #define bfd_sym_new_section_hook    _bfd_generic_new_section_hook
 #define bfd_sym_bfd_is_local_label_name    bfd_generic_is_local_label_name
-#define bfd_sym_bfd_is_target_special_symbol   ((bfd_boolean (*) (bfd *, asymbol *)) (bfd_boolean (*)) bfd_false)
+#define bfd_sym_bfd_is_target_special_symbol   ((bfd_boolean (*) (bfd *, asymbol *)) (void (*) (void)) bfd_false)
 #define bfd_sym_get_lineno    _bfd_nosymbols_get_lineno
 #define bfd_sym_find_nearest_line    _bfd_nosymbols_find_nearest_line
 #define bfd_sym_find_line    _bfd_nosymbols_find_line
Reply | Threaded
Open this post in threaded view
|

Re: Commit: PR 22823: Fix gcc 8 compile time warnings

Alan Modra-3
On Thu, Feb 15, 2018 at 08:37:49AM +0000, Maciej W. Rozycki wrote:
> however (we have `-Wstrict-prototypes' spelled out explicitly).  It looks
> like casting to `void (*) (void)' is the way to calm GCC, according to
> `-Wcast-function-type' option documentation (if all else fails, check the
> manual).

Just plain (void *) works too.

--
Alan Modra
Australia Development Lab, IBM