[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmis
From: |
M. Warner Losh |
Subject: |
Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes |
Date: |
Mon, 11 Aug 2008 07:30:42 -0600 (MDT) |
In message: <address@hidden>
Gerd Hoffmann <address@hidden> writes:
: Blue Swirl wrote:
: > On 8/9/08, Anthony Liguori <address@hidden> wrote:
: >> 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)
: [ ... ]
:
: > 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.
:
: Using a union maybe?
:
: typedef struct term_cmd_t {
: [ ... ]
: union {
: void (*help)(const char name);
: void (*quit)(void);
: [ ... ]
: } handlers;
: [ ... ]
: };
Or just have all the commands use the same arguments? That's usually
how this is done. (*handler) should take a void *, which the callee
can do whatever it wants with...
Warner
- [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Blue Swirl, 2008/08/08
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Anthony Liguori, 2008/08/09
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Blue Swirl, 2008/08/10
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Gerd Hoffmann, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Samuel Thibault, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, M. Warner Losh, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes,
M. Warner Losh <=
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Anthony Liguori, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Avi Kivity, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Paul Brook, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Laurent Vivier, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Anthony Liguori, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Avi Kivity, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Anthony Liguori, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Blue Swirl, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Laurent Vivier, 2008/08/11
- Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes, Blue Swirl, 2008/08/11