Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
To: gdb-patches@sources.redhat.com
Subject: [RFC] trying to kill a warning in hpread.c (from call to complaint)
Date: Fri, 10 Jan 2003 14:26:00 -0000	[thread overview]
Message-ID: <20030110142639.GC30359@gnat.com> (raw)

Hello,

I see the following warnings when compiling hpread.c:

        hpread.c:1920: warning: int format, pointer arg (arg 3)
        hpread.c:2025: warning: int format, pointer arg (arg 3)
        hpread.c:2051: warning: int format, pointer arg (arg 3)
        hpread.c:2072: warning: int format, pointer arg (arg 3)
        hpread.c:2146: warning: int format, pointer arg (arg 3)
        hpread.c:2230: warning: int format, pointer arg (arg 3)

These warnings point to the following macro:

#define SET_NAMESTRING(SYM, NAMEP, OBJFILE) \
  if (! hpread_has_name ((SYM)->dblock.kind)) \
    *NAMEP = ""; \
  else if (((unsigned)(SYM)->dsfile.name) >= VT_SIZE (OBJFILE)) \
    { \
      complaint (&symfile_complaints, "bad string table offset in symbol %d", \
                 (char *) symnum); \
      *NAMEP = ""; \
    } \
  else \
    *NAMEP = (SYM)->dsfile.name + VT (OBJFILE)

I think that the warning comes from the call to complaint where the
format string contains "%d", but the next parameter is casted to a
"char *".

Is the cast to "char *" necessary? Can/Should I remove it?

Thanks,
-- 
Joel


             reply	other threads:[~2003-01-10 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-10 14:26 Joel Brobecker [this message]
2003-01-10 14:34 ` Daniel Jacobowitz
2003-01-10 16:08   ` Andrew Cagney
2003-01-10 16:13     ` Daniel Jacobowitz

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=20030110142639.GC30359@gnat.com \
    --to=brobecker@gnat.com \
    --cc=gdb-patches@sources.redhat.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