public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [Bug general/24068] New: readelf.c:10152:15: error: ‘%*llx’ directive output between 4 and 2147483647 bytes may cause result to exceed ‘INT_MAX’ [-Werror=format-overflow=] with -m32
@ 2019-01-06 15:58 marxin.liska at gmail dot com
  2019-01-13 17:02 ` [Bug general/24068] " mark at klomp dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: marxin.liska at gmail dot com @ 2019-01-06 15:58 UTC (permalink / raw)
  To: elfutils-devel

https://sourceware.org/bugzilla/show_bug.cgi?id=24068

            Bug ID: 24068
           Summary: readelf.c:10152:15: error: ‘%*llx’ directive output
                    between 4 and 2147483647 bytes may cause result to
                    exceed ‘INT_MAX’ [-Werror=format-overflow=] with -m32
           Product: elfutils
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: general
          Assignee: unassigned at sourceware dot org
          Reporter: marxin.liska at gmail dot com
                CC: elfutils-devel at sourceware dot org
  Target Milestone: ---

Using latest GCC and -m32 (on x86_64-linux-gnu), one can see:

$ gcc -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"/usr/local/share/locale"' 
-DDEBUGPRED=0 -DSRCDIR=\"/home/marxin/Programming/elfutils/src\"
-DOBJDIR=\"/home/marxin/Programming/elfutils/src\" -I. -I..  -I. -I. -I../lib
-I.. -I./../libelf -I./../libebl -I./../libdw -I./../libdwelf -I./../libdwfl
-I./../libasm  -std=gnu99 -Wall -Wshadow -Wformat=2 -Wold-style-definition
-Wstrict-prototypes -Wtrampolines -Wlogical-op -Wduplicated-cond
-Wnull-dereference -Wimplicit-fallthrough=5 -Werror -Wunused -Wextra   
-D_FORTIFY_SOURCE=2 -g -O2 -MT readelf.o -MD -MP -MF .deps/readelf.Tpo -c -o
readelf.o readelf.c -m32
readelf.c: In function ‘print_debug_str_section’:
readelf.c:10152:15: error: ‘%*llx’ directive output between 4 and 2147483647
bytes may cause result to exceed ‘INT_MAX’ [-Werror=format-overflow=]
10152 |       printf (" [%*" PRIx64 "]  \"%s\"\n", digits, (uint64_t) offset,
str);
      |               ^~~~~~
readelf.c:10152:18: note: format string is defined here
10152 |       printf (" [%*" PRIx64 "]  \"%s\"\n", digits, (uint64_t) offset,
str);
readelf.c:10152:15: note: directive argument in the range [0,
18446744073709551614]
10152 |       printf (" [%*" PRIx64 "]  \"%s\"\n", digits, (uint64_t) offset,
str);
      |               ^~~~~~
cc1: all warnings being treated as errors

Can you please check that?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-06 11:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-06 15:58 [Bug general/24068] New: readelf.c:10152:15: error: ‘%*llx’ directive output between 4 and 2147483647 bytes may cause result to exceed ‘INT_MAX’ [-Werror=format-overflow=] with -m32 marxin.liska at gmail dot com
2019-01-13 17:02 ` [Bug general/24068] " mark at klomp dot org
2019-01-14 10:26 ` marxin.liska at gmail dot com
2023-10-06 11:03 ` mark at klomp dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).