mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 13:27:26 +08:00
Suppress compile time warning message when compiling coff-rs6000.c with gcc v8.
* coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Suppress warnings about potentially truncated strncpy operations. (_bfd_xcoff_put_symbol_name): Likewise.
This commit is contained in:
@ -1,5 +1,9 @@
|
|||||||
2018-08-01 Nick Clifton <nickc@redhat.com>
|
2018-08-01 Nick Clifton <nickc@redhat.com>
|
||||||
|
|
||||||
|
* coff-rs6000.c (_bfd_xcoff_put_ldsymbol_name): Suppress warnings
|
||||||
|
about potentially truncated strncpy operations.
|
||||||
|
(_bfd_xcoff_put_symbol_name): Likewise.
|
||||||
|
|
||||||
* elf32-avr.c (avr_stub_name): Check for a NULL return from
|
* elf32-avr.c (avr_stub_name): Check for a NULL return from
|
||||||
bfd_malloc.
|
bfd_malloc.
|
||||||
|
|
||||||
|
@ -3506,6 +3506,23 @@ xcoff_ppc_relocate_section (bfd *output_bfd,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* gcc-8 warns (*) on all the strncpy calls in this function about
|
||||||
|
possible string truncation. The "truncation" is not a bug. We
|
||||||
|
have an external representation of structs with fields that are not
|
||||||
|
necessarily NULL terminated and corresponding internal
|
||||||
|
representation fields that are one larger so that they can always
|
||||||
|
be NULL terminated.
|
||||||
|
gcc versions between 4.2 and 4.6 do not allow pragma control of
|
||||||
|
diagnostics inside functions, giving a hard error if you try to use
|
||||||
|
the finer control available with later versions.
|
||||||
|
gcc prior to 4.2 warns about diagnostic push and pop.
|
||||||
|
gcc-5, gcc-6 and gcc-7 warn that -Wstringop-truncation is unknown,
|
||||||
|
unless you also add #pragma GCC diagnostic ignored "-Wpragma".
|
||||||
|
(*) Depending on your system header files! */
|
||||||
|
#if GCC_VERSION >= 8000
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||||
|
#endif
|
||||||
static bfd_boolean
|
static bfd_boolean
|
||||||
_bfd_xcoff_put_ldsymbol_name (bfd *abfd ATTRIBUTE_UNUSED,
|
_bfd_xcoff_put_ldsymbol_name (bfd *abfd ATTRIBUTE_UNUSED,
|
||||||
struct xcoff_loader_info *ldinfo,
|
struct xcoff_loader_info *ldinfo,
|
||||||
@ -3575,6 +3592,9 @@ _bfd_xcoff_put_symbol_name (struct bfd_link_info *info,
|
|||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
#if GCC_VERSION >= 8000
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
static asection *
|
static asection *
|
||||||
xcoff_create_csect_from_smclas (bfd *abfd,
|
xcoff_create_csect_from_smclas (bfd *abfd,
|
||||||
|
Reference in New Issue
Block a user