aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2023-02-28 11:04:33 +1030
committerAlan Modra <amodra@gmail.com>2023-02-28 11:06:41 +1030
commit26c294bd1b8d95b421487294863eb1560b65580d (patch)
tree7ebe5f9bd74287b9fe0be56f6de06af9c7af503b
parent38395c77d7619fb32885468f52edf566ab84d411 (diff)
downloadgdb-26c294bd1b8d95b421487294863eb1560b65580d.zip
gdb-26c294bd1b8d95b421487294863eb1560b65580d.tar.gz
gdb-26c294bd1b8d95b421487294863eb1560b65580d.tar.bz2
chew.c printf of intptr_t
Seen when building binutils with gcc -m32 on x86_64-linux. chew.c: In function ‘print’: chew.c:1434:59: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 3 has type ‘intptr_t’ {aka ‘int’} [-Wformat=] 1434 | fprintf (stderr, "print: illegal print destination `%ld'\n", *isp); | ~~^ ~~~~ | | | | | intptr_t {aka int} | long int | %d * chew.c: Include inttypes.h. (print): Use PRIdPTR for *isp.
-rw-r--r--bfd/doc/chew.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c
index e847896..5257bf4 100644
--- a/bfd/doc/chew.c
+++ b/bfd/doc/chew.c
@@ -91,6 +91,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
+#include <inttypes.h>
#define DEF_SIZE 5000
#define STACK 50
@@ -1431,7 +1432,7 @@ print (void)
else if (*isp == 2)
write_buffer (tos, stderr);
else
- fprintf (stderr, "print: illegal print destination `%ld'\n", *isp);
+ fprintf (stderr, "print: illegal print destination `%" PRIdPTR "'\n", *isp);
isp--;
tos--;
icheck_range ();