public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gprofng/testsuite: eliminate bogus casts
@ 2022-12-19 8:36 Jan Beulich
0 siblings, 0 replies; only message in thread
From: Jan Beulich @ 2022-12-19 8:36 UTC (permalink / raw)
To: bfd-cvs, gdb-cvs
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f8b6a781fb6b7e799c95c1c2be87accc39c0b7c0
commit f8b6a781fb6b7e799c95c1c2be87accc39c0b7c0
Author: Jan Beulich <jbeulich@suse.com>
Date: Mon Dec 19 09:36:00 2022 +0100
gprofng/testsuite: eliminate bogus casts
Casting pointers to unsigned int is generally problematic and hence
compilers tend to warn about such. While here they're used only in
fprintf(), it still seems better to omit such casts, even if only to
avoid setting bad precedents.
Diff:
---
gprofng/testsuite/gprofng.display/synprog/so_syn.c | 2 +-
gprofng/testsuite/gprofng.display/synprog/so_syx.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gprofng/testsuite/gprofng.display/synprog/so_syn.c b/gprofng/testsuite/gprofng.display/synprog/so_syn.c
index 6fc5aa61163..d6c9331f9d5 100644
--- a/gprofng/testsuite/gprofng.display/synprog/so_syn.c
+++ b/gprofng/testsuite/gprofng.display/synprog/so_syn.c
@@ -32,7 +32,7 @@ so_cputime ()
/* put a memory leak in here */
(void) malloc (13);
- fprintf (stderr, "so_burncpu @ 0x%08x\n", (unsigned int) so_burncpu);
+ fprintf (stderr, "so_burncpu @ %p\n", so_burncpu);
so_burncpu ();
wlog ("end of so_cputime", NULL);
diff --git a/gprofng/testsuite/gprofng.display/synprog/so_syx.c b/gprofng/testsuite/gprofng.display/synprog/so_syx.c
index ae7da6f7414..1994a0aca11 100644
--- a/gprofng/testsuite/gprofng.display/synprog/so_syx.c
+++ b/gprofng/testsuite/gprofng.display/synprog/so_syx.c
@@ -32,7 +32,7 @@ sx_cputime ()
/* put a memory leak in here */
(void) malloc (13);
- fprintf (stderr, "sx_burncpu @ 0x%08x\n", (unsigned int) sx_burncpu);
+ fprintf (stderr, "sx_burncpu @ %p\n", sx_burncpu);
sx_burncpu ();
wlog ("end of sx_cputime", NULL);
return 13;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-12-19 8:36 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-19 8:36 [binutils-gdb] gprofng/testsuite: eliminate bogus casts Jan Beulich
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).