public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Cc: Binutils <binutils@sourceware.org>
Subject: [PATCH 4/4] gprofng/testsuite: eliminate bogus casts
Date: Fri, 16 Dec 2022 09:30:30 +0100	[thread overview]
Message-ID: <f0679195-cfa8-6f87-2519-520f758e615e@suse.com> (raw)
In-Reply-To: <fb6f3da8-42fc-6911-fcc9-a444bc41df0c@suse.com>

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.

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


  parent reply	other threads:[~2022-12-16  8:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-16  8:26 [PATCH 0/4] gprofng: small testsuite adjustments Jan Beulich
2022-12-16  8:28 ` [PATCH 1/4] gprofng/testsuite: adjust linking of synprog Jan Beulich
2022-12-16  8:29 ` [PATCH 2/4] gprofng/testsuite: correct names for signal handling tests Jan Beulich
2022-12-16  8:30 ` [PATCH 3/4] gprofng/testsuite: correct line continuation in endcases.c Jan Beulich
2022-12-16  8:30 ` Jan Beulich [this message]
2022-12-16  8:36 ` [PATCH 0/4] gprofng: small testsuite adjustments Jan Beulich
2022-12-16  9:13 ` [PATCH 5/4] gprofng/testsuite: skip Java test without JDK Jan Beulich
2022-12-16 20:16 ` [PATCH 0/4] gprofng: small testsuite adjustments Vladimir Mezentsev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f0679195-cfa8-6f87-2519-520f758e615e@suse.com \
    --to=jbeulich@suse.com \
    --cc=binutils@sourceware.org \
    --cc=vladimir.mezentsev@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).