qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Blue Swirl" <blauwirbel@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes
Date: Sun, 10 Aug 2008 21:33:49 +0300	[thread overview]
Message-ID: <f43fc5580808101133r28b4343di4b25404067c13552@mail.gmail.com> (raw)
In-Reply-To: <489DE0C7.9000505@codemonkey.ws>

On 8/9/08, Anthony Liguori <anthony@codemonkey.ws> wrote:
> Blue Swirl wrote:
>
> > Hi,
> >
> > I made a series of patches that add -Wstrict-prototypes to the CFLAGS
> > and then -Wmissing-prototypes, both of which are enabled by Xen. I
> > also fixed most warnings generated -Wstrict-prototypes and some of
> > them for the -Wmissing-prototypes case.
> >
> > Compiling with -Wstrict-prototypes produces only one extra warning. I
> > think this flag should be enabled.
> >
> >
>
>  As long as the plan is to fix all of those warnings, I think it's a good
> idea.

The extra unfixed warning comes from monitor.c:
typedef struct term_cmd_t {
    const char *name;
    const char *args_type;
    void (*handler)();
    const char *params;
    const char *help;
} term_cmd_t;

The warning is generated because the definition of "handler" should
also describe the parameters and not use the old () style. But in this
case, they can vary:
static void do_help(const char *name)
static void do_quit(void)
static void do_eject(int force, const char *filename)
static void do_change(const char *device, const char *target, const char *fmt)
static void do_screen_dump(const char *filename)
static void do_memory_dump(int count, int format, int size,
                           uint32_t addrh, uint32_t addrl)
static void do_print(int count, int format, int size, unsigned int
valh, unsigned int vall)
static void do_ioport_read(int count, int format, int size, int addr,
int has_index, int index)
etc.

I don't have a good plan how to fix this, proposals are welcome.
Changing all handlers to use va_args to just silence a gcc warning
sounds like overkill.

  reply	other threads:[~2008-08-10 18:33 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-08 17:22 [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes Blue Swirl
2008-08-09 18:24 ` Anthony Liguori
2008-08-10 18:33   ` Blue Swirl [this message]
2008-08-11  7:52     ` Gerd Hoffmann
2008-08-11  9:54       ` Samuel Thibault
2008-08-11 13:32         ` M. Warner Losh
2008-08-11 13:30       ` M. Warner Losh
2008-08-11 14:21     ` Anthony Liguori
2008-08-11 14:48       ` Avi Kivity
2008-08-11 14:53         ` Paul Brook
2008-08-11 14:56         ` Laurent Vivier
2008-08-11 14:56         ` Anthony Liguori
2008-08-11 16:38           ` Avi Kivity
2008-08-11 16:47             ` Anthony Liguori
2008-08-11 18:52               ` Blue Swirl
2008-08-11 18:57                 ` Laurent Vivier
2008-08-11 19:11                   ` Blue Swirl
2008-08-11 19:22                   ` Anthony Liguori
2008-08-11 20:03                     ` Laurent Vivier
2008-08-12  1:57                       ` Anthony Liguori
2008-08-12  8:14                         ` Laurent Vivier
2008-08-12  9:22                         ` Avi Kivity
2008-08-12 12:24                     ` 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=f43fc5580808101133r28b4343di4b25404067c13552@mail.gmail.com \
    --to=blauwirbel@gmail.com \
    --cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).