From: Stefan Weil <sw@weilnetz.de>
To: Richard Henderson <rth@twiddle.net>, qemu-trivial@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] util: Add 'static' attribute to function implementation
Date: Sun, 16 Mar 2014 19:42:04 +0100 [thread overview]
Message-ID: <5325F07C.80004@weilnetz.de> (raw)
In-Reply-To: <5325E841.3080508@twiddle.net>
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 <rth@twiddle.net>
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
WARNING: multiple messages have this Message-ID (diff)
From: Stefan Weil <sw@weilnetz.de>
To: Richard Henderson <rth@twiddle.net>, qemu-trivial@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] util: Add 'static' attribute to function implementation
Date: Sun, 16 Mar 2014 19:42:04 +0100 [thread overview]
Message-ID: <5325F07C.80004@weilnetz.de> (raw)
In-Reply-To: <5325E841.3080508@twiddle.net>
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 <rth@twiddle.net>
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
next prev parent reply other threads:[~2014-03-16 18:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-16 18:02 [Qemu-trivial] [PATCH] util: Add 'static' attribute to function implementation Stefan Weil
2014-03-16 18:02 ` [Qemu-devel] " Stefan Weil
2014-03-16 18:06 ` [Qemu-trivial] " Richard Henderson
2014-03-16 18:06 ` Richard Henderson
2014-03-16 18:42 ` Stefan Weil [this message]
2014-03-16 18:42 ` Stefan Weil
2014-03-17 16:49 ` [Qemu-trivial] " Richard Henderson
2014-03-17 16:49 ` Richard Henderson
2014-03-17 14:46 ` [Qemu-trivial] " Michael Tokarev
2014-03-17 14:46 ` [Qemu-devel] " Michael Tokarev
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5325F07C.80004@weilnetz.de \
--to=sw@weilnetz.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.