[PATCH] bfd: add stdlib.h when using abort

Mike Frysinger vapier@gentoo.org
Mon Apr 19 14:40:38 GMT 2021


On 19 Apr 2021 11:15, Andreas Schwab wrote:
> On Apr 18 2021, Mike Frysinger via Binutils wrote:
> > Since this file calls abort() now, we need to include stdlib.h for
> > its prototype.
> 
> That should come from bfd/sysdep.h.

what do you suggest for these ?

In file included from sim/cris/sim-if.c:26:
sim/cris/../../bfd/elf-bfd.h: In function ‘elf_link_hash_lookup’:
sim/cris/../../bfd/elf-bfd.h:729:5: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration]
  729 |     abort ();
      |     ^~~~~
sim/cris/../../bfd/elf-bfd.h:729:5: warning: incompatible implicit declaration of built-in function ‘abort’
sim/cris/../../bfd/elf-bfd.h:29:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘abort’
   28 | #include "bfdlink.h"
  +++ |+#include <stdlib.h>
   29 | 
sim/cris/../../bfd/elf-bfd.h: In function ‘elf_link_hash_traverse’:
sim/cris/../../bfd/elf-bfd.h:742:5: warning: incompatible implicit declaration of built-in function ‘abort’
  742 |     abort ();
      |     ^~~~~
sim/cris/../../bfd/elf-bfd.h:742:5: note: include ‘<stdlib.h>’ or provide a declaration of ‘abort’


In file included from sim/m68hc11/../../bfd/elf32-m68hc1x.h:25,
                 from sim/m68hc11/interp.c:27:
sim/m68hc11/../../bfd/elf-bfd.h: In function ‘elf_link_hash_lookup’:
sim/m68hc11/../../bfd/elf-bfd.h:729:5: warning: implicit declaration of function ‘abort’ [-Wimplicit-function-declaration]
  729 |     abort ();
      |     ^~~~~
sim/m68hc11/../../bfd/elf-bfd.h:729:5: warning: incompatible implicit declaration of built-in function ‘abort’
sim/m68hc11/../../bfd/elf-bfd.h:29:1: note: include ‘<stdlib.h>’ or provide a declaration of ‘abort’
   28 | #include "bfdlink.h"
  +++ |+#include <stdlib.h>
   29 | 
sim/m68hc11/../../bfd/elf-bfd.h: In function ‘elf_link_hash_traverse’:
sim/m68hc11/../../bfd/elf-bfd.h:742:5: warning: incompatible implicit declaration of built-in function ‘abort’
  742 |     abort ();
      |     ^~~~~
sim/m68hc11/../../bfd/elf-bfd.h:742:5: note: include ‘<stdlib.h>’ or provide a declaration of ‘abort’



More information about the Binutils mailing list