Received: from eggs.gnu.org ([2001:4830:134:3::10]:42604) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WPG0x-00010W-DS for qemu-devel@nongnu.org; Sun, 16 Mar 2014 14:42:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WPG0q-0006XH-9F for qemu-devel@nongnu.org; Sun, 16 Mar 2014 14:42:27 -0400 Message-ID: <5325F07C.80004@weilnetz.de> Date: Sun, 16 Mar 2014 19:42:04 +0100 From: Stefan Weil MIME-Version: 1.0 References: <1394992972-23004-1-git-send-email-sw@weilnetz.de> <5325E841.3080508@twiddle.net> In-Reply-To: <5325E841.3080508@twiddle.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] util: Add 'static' attribute to function implementation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson , qemu-trivial@nongnu.org Cc: qemu-devel@nongnu.org Am 16.03.2014 19:06, schrieb Richard Henderson: > On 03/16/2014 11:02 AM, Stefan Weil wrote: >> 'static' is used in the forward declaration, but not in the implementation. >> Add it there, too. > > You might consider reporting this as a bug in the analyzer, since the static in > the forward declaration does apply to the definition. > > That said, for style it's usually better to make them match, so, > > Reviewed-by: Richard Henderson Yes, the forward declaration applies here. IMHO it helps human reviewers if they can see directly that some function is only local, therefore I prefer the attribute 'static' at both code locations. We have a similar situation with other attributes, too. Smatch also complains about missing QEMU_NORETURN in our implementation code (we add it only in header files for global functions). Do you think it would be good to make header and implementation match there, too? Stefan