[4/4] gprofng/testsuite: eliminate bogus casts

Message ID f0679195-cfa8-6f87-2519-520f758e615e@suse.com
State Accepted
Headers
Series gprofng: small testsuite adjustments |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Jan Beulich Dec. 16, 2022, 8:30 a.m. UTC
  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.
  

Patch

--- 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);
--- 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;