* [PATCH] checkpatch: warn on declaration with storage class not at the beginning
@ 2010-05-20 15:18 Tobias Klauser
2010-05-21 7:13 ` [PATCH] checkpatch: warn on declaration with storage class not Jean Delvare
0 siblings, 1 reply; 2+ messages in thread
From: Tobias Klauser @ 2010-05-20 15:18 UTC (permalink / raw)
To: kernel-janitors
The C99 specification states in section 6.11.5:
The placement of a storage-class specifier other than at the beginning
of the declaration specifiers in a declaration is an obsolescent
feature.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Cc: Jean Delvare <khali@linux-fr.org>
---
scripts/checkpatch.pl | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index f2bbea9..4921473 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -2586,6 +2586,11 @@ sub process {
CHK("architecture specific defines should be avoided\n" . $herecurr);
}
+# Check that the storage class is at the beginning of a declaration
+ if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
+ WARN("storage class should be at the beginning of the declaration\n" . $herecurr)
+ }
+
# check the location of the inline attribute, that it is between
# storage class and type.
if ($line =~ /\b$Type\s+$Inline\b/ ||
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] checkpatch: warn on declaration with storage class not
2010-05-20 15:18 [PATCH] checkpatch: warn on declaration with storage class not at the beginning Tobias Klauser
@ 2010-05-21 7:13 ` Jean Delvare
0 siblings, 0 replies; 2+ messages in thread
From: Jean Delvare @ 2010-05-21 7:13 UTC (permalink / raw)
To: kernel-janitors
On Thu, 20 May 2010 17:18:53 +0200, Tobias Klauser wrote:
> The C99 specification states in section 6.11.5:
>
> The placement of a storage-class specifier other than at the beginning
> of the declaration specifiers in a declaration is an obsolescent
> feature.
>
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> Cc: Jean Delvare <khali@linux-fr.org>
Acked-by: Jean Delvare <khali@linux-fr.org>
> ---
> scripts/checkpatch.pl | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index f2bbea9..4921473 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -2586,6 +2586,11 @@ sub process {
> CHK("architecture specific defines should be avoided\n" . $herecurr);
> }
>
> +# Check that the storage class is at the beginning of a declaration
> + if ($line =~ /\b$Storage\b/ && $line !~ /^.\s*$Storage\b/) {
> + WARN("storage class should be at the beginning of the declaration\n" . $herecurr)
> + }
> +
> # check the location of the inline attribute, that it is between
> # storage class and type.
> if ($line =~ /\b$Type\s+$Inline\b/ ||
--
Jean Delvare
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-05-21 7:13 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-20 15:18 [PATCH] checkpatch: warn on declaration with storage class not at the beginning Tobias Klauser
2010-05-21 7:13 ` [PATCH] checkpatch: warn on declaration with storage class not Jean Delvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox