From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSFjl-0000xp-VI for qemu-devel@nongnu.org; Sun, 10 Aug 2008 14:33:53 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSFjk-0000xH-5E for qemu-devel@nongnu.org; Sun, 10 Aug 2008 14:33:53 -0400 Received: from [199.232.76.173] (port=35161 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSFjk-0000x9-1m for qemu-devel@nongnu.org; Sun, 10 Aug 2008 14:33:52 -0400 Received: from wf-out-1314.google.com ([209.85.200.171]:64001) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSFjj-0003h2-Dz for qemu-devel@nongnu.org; Sun, 10 Aug 2008 14:33:51 -0400 Received: by wf-out-1314.google.com with SMTP id 27so3316305wfd.4 for ; Sun, 10 Aug 2008 11:33:49 -0700 (PDT) Message-ID: Date: Sun, 10 Aug 2008 21:33:49 +0300 From: "Blue Swirl" Subject: Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes In-Reply-To: <489DE0C7.9000505@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <489DE0C7.9000505@codemonkey.ws> 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 On 8/9/08, Anthony Liguori 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.