[Bug tree-optimization/88835] overly aggressive -Werror=format-overflow for printf since r265648

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 15 00:26:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88835

--- Comment #11 from Martin Sebor <msebor at gcc dot gnu.org> ---
Ah, but you mentioned elfutilts, not binutils.  I've now downloaded and built
elfutils-0.175.  It took a bit more effort because --disable-werror doesn't
work there but once I got past that I just got the three -Wformat-truncation
instances below:

Diagnostic                        Count   Unique    Files
-Wformat-truncation=                  3        3        2

-Wformat-truncation Instances:
  /src/elfutils-0.175/src/ar.c:1468
  /src/elfutils-0.175/src/ar.c:859
  /src/elfutils-0.175/src/arlib.c:63

The code at line 10167 in readelf.c looks like this:

static void
print_debug_str_offsets_section (Dwfl_Module *dwflmod __attribute__ ((unused)),
                                 Ebl *ebl,
                                 GElf_Ehdr *ehdr __attribute__ ((unused)),
                                 Elf_Scn *scn, GElf_Shdr *shdr, Dwarf *dbg)
{
  printf (gettext ("\
\nDWARF section [%2zu] '%s' at offset %#" PRIx64 ":\n"),
          elf_ndxscn (scn), section_name (ebl, shdr),
          (uint64_t) shdr->sh_offset);

I'm probably not using the same sources as you, but shouldn't I be seeing at
least some of the warnings?  (I couldn't find an easy way build the top of
trunk -- there's no configure script.)


More information about the Gcc-bugs mailing list