From: Jim Blandy <jimb@red-bean.com>
To: gdb-patches@sourceware.org
Subject: Re: [ob] More warnings; Call for assistance
Date: Tue, 17 Jan 2006 19:37:00 -0000 [thread overview]
Message-ID: <8f2776cb0601171137yffbcd4exefdefe7c8a79bbf3@mail.gmail.com> (raw)
In-Reply-To: <20060117152156.GA3115@nevyn.them.org>
Looking at the printcmd.c warnings, there's the following note in Makefile.in:
# FIXME: cagney/2003-08-10: Do not try to build "printcmd.c" with
# -Wformat-nonliteral. It needs to be overhauled so that it doesn't
# pass user input strings as the format parameter to host printf
# function calls.
printcmd.o: $(srcdir)/printcmd.c
$(CC) -c $(INTERNAL_WARN_CFLAGS) $(NO_WERROR_CFLAGS) $(srcdir)/printcmd.c
I gather what this is suggesting is that we have a big switch
selecting an appropriate call to printf that uses a fixed format
string.
There will be dozens of cases there, due to the modifiers (h, l, ll,
precision, leading sign, alternative form). The precisions will need
to be parsed when present; sometimes they are minimum values,
sometimes they are maximum values. Since we check the number and type
of the arguments, I think -Wformat-nonliteral is the right answer
here. I don't see a benefit to making this change that justifies the
risk of mistakes.
What do folks think?
next prev parent reply other threads:[~2006-01-17 19:37 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-17 15:17 Daniel Jacobowitz
2006-01-17 15:22 ` Daniel Jacobowitz
2006-01-17 19:37 ` Jim Blandy [this message]
2006-01-17 19:46 ` Daniel Jacobowitz
2006-01-17 20:11 ` Eli Zaretskii
2006-01-20 23:06 ` Daniel Jacobowitz
2006-01-21 10:07 ` Eli Zaretskii
2006-01-21 15:18 ` Daniel Jacobowitz
2006-01-17 20:57 ` Jim Blandy
2006-01-17 20:17 ` Eli Zaretskii
2006-01-20 23:09 ` Daniel Jacobowitz
2006-01-17 20:19 ` Eli Zaretskii
2006-01-17 20:23 ` Daniel Jacobowitz
2006-01-17 21:08 ` Eli Zaretskii
2006-01-17 21:14 ` Daniel Jacobowitz
2006-01-18 4:16 ` Eli Zaretskii
2006-01-18 1:15 ` Jim Blandy
2006-01-18 23:33 ` 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=8f2776cb0601171137yffbcd4exefdefe7c8a79bbf3@mail.gmail.com \
--to=jimb@red-bean.com \
--cc=gdb-patches@sourceware.org \
/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