From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSSCL-0007ra-57 for qemu-devel@nongnu.org; Mon, 11 Aug 2008 03:52:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSSCJ-0007rO-SD for qemu-devel@nongnu.org; Mon, 11 Aug 2008 03:52:12 -0400 Received: from [199.232.76.173] (port=40879 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSSCJ-0007rL-Kk for qemu-devel@nongnu.org; Mon, 11 Aug 2008 03:52:11 -0400 Received: from mx1.redhat.com ([66.187.233.31]:58421) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSSCJ-0006hE-CL for qemu-devel@nongnu.org; Mon, 11 Aug 2008 03:52:11 -0400 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m7B7q52i017911 for ; Mon, 11 Aug 2008 03:52:05 -0400 Received: from pobox.stuttgart.redhat.com (pobox.stuttgart.redhat.com [172.16.2.10]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m7B7q4MP011215 for ; Mon, 11 Aug 2008 03:52:04 -0400 Received: from zweiblum.travel.kraxel.org (vpn-4-72.str.redhat.com [10.32.4.72]) by pobox.stuttgart.redhat.com (8.13.1/8.13.1) with ESMTP id m7B7q3G5016324 for ; Mon, 11 Aug 2008 03:52:04 -0400 Message-ID: <489FEFA3.3040105@redhat.com> Date: Mon, 11 Aug 2008 09:52:03 +0200 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes References: <489DE0C7.9000505@codemonkey.ws> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Blue Swirl wrote: > On 8/9/08, Anthony Liguori 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; [ ... ] }; cheers, Gerd -- http://kraxel.fedorapeople.org/xenner/