qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmis


From: Blue Swirl
Subject: Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes
Date: Sun, 10 Aug 2008 21:33:49 +0300

On 8/9/08, Anthony Liguori <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]