From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KSsv2-0007aO-RI for qemu-devel@nongnu.org; Tue, 12 Aug 2008 08:24:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KSsv2-0007Yx-2f for qemu-devel@nongnu.org; Tue, 12 Aug 2008 08:24:08 -0400 Received: from [199.232.76.173] (port=38365 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KSsv1-0007Yd-U0 for qemu-devel@nongnu.org; Tue, 12 Aug 2008 08:24:07 -0400 Received: from nan.false.org ([208.75.86.248]:34995) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KSsv1-0007cK-Uy for qemu-devel@nongnu.org; Tue, 12 Aug 2008 08:24:08 -0400 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 58DAA983B4 for ; Tue, 12 Aug 2008 12:24:05 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 33B0598015 for ; Tue, 12 Aug 2008 12:24:05 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1KSsuy-0007rl-KC for qemu-devel@nongnu.org; Tue, 12 Aug 2008 08:24:04 -0400 Date: Tue, 12 Aug 2008 08:24:04 -0400 From: Daniel Jacobowitz Subject: Re: [Qemu-devel] [RFC, PATCH] Add -Wstrict-prototypes, maybe later -Wmissing-prototypes Message-ID: <20080812122404.GA29630@caradoc.them.org> References: <489DE0C7.9000505@codemonkey.ws> <48A04ACD.5090900@codemonkey.ws> <48A05150.2040405@qumranet.com> <48A0533A.9020707@codemonkey.ws> <48A06B12.5000701@qumranet.com> <48A06D07.60103@codemonkey.ws> <48A09168.6000301@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48A09168.6000301@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 Mon, Aug 11, 2008 at 02:22:16PM -0500, Anthony Liguori wrote: > But this tosses a warning since void (*)() is deprecated. So, if we use: > > void dispatch(void *func, int n_args, void *args) > > It'll work just like it did before. Just for the record: while you're correct this will work on mainstream systems (you've been saying modern, which is not accurate), it is not valid C. The C standard only permits conversions between pointers to different object types, or between pointers to different function types. Pointers can also be converted to integers but "the result need not be in the range of values of any integer type". GCC will even warn about it: ISO C forbids conversion of object pointer to function pointer type -- Daniel Jacobowitz CodeSourcery