From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LZ8mS-0001cN-Ki for qemu-devel@nongnu.org; Mon, 16 Feb 2009 14:05:24 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LZ8mP-0001c8-5M for qemu-devel@nongnu.org; Mon, 16 Feb 2009 14:05:24 -0500 Received: from [199.232.76.173] (port=37850 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LZ8mP-0001c5-1v for qemu-devel@nongnu.org; Mon, 16 Feb 2009 14:05:21 -0500 Received: from moutng.kundenserver.de ([212.227.126.188]:51108) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LZ8mO-0007eQ-Bz for qemu-devel@nongnu.org; Mon, 16 Feb 2009 14:05:20 -0500 Received: from localhost ([127.0.0.1] ident=stefan) by flocke.weilnetz.de with esmtp (Exim 4.69) (envelope-from ) id 1LZ8mL-0001Tb-KS for qemu-devel@nongnu.org; Mon, 16 Feb 2009 20:05:18 +0100 Message-ID: <4999B8E8.50509@mail.berlios.de> Date: Mon, 16 Feb 2009 20:05:12 +0100 From: Stefan Weil MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Add QEMU_NORETURN to some functions References: <4995E9A8.6030403@mail.berlios.de> <49998EBF.20006@codemonkey.ws> In-Reply-To: <49998EBF.20006@codemonkey.ws> Content-Type: text/plain; charset=ISO-8859-15 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 Anthony Liguori schrieb: > Stefan Weil wrote: >> Hello, >> >> this patch adds the QEMU_NORETURN attribute to several functions. >> > > Based on some IRC discussion, the best place to use QEMU_NORETURN is > in header files. If you add it to a C file, you don't really need it > (since the compiler can determine this anyway). > > Regards, > > Anthony Liguori This is correct - in theory. I have put all QEMU_NORETURN in header files were possible. In practice, there remain two cases which are exceptions to the rule: Without the attribute, gcc will give warnings (when they are enabled) for static functions which don't return. It could determine this automatically, but it does not. And for some helper functions, there are no simple prototypes in header files because they are built by compiler macros, so it is difficult to add the attribute in the header. If we want to allow -Wmissing-noreturn some day (which is needed to see the interesting functions), I think we have to accept these two exceptions. Regards Stefan Weil