projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3354957
)
checkpatch: warn on declaration with storage class not at the beginning
author
Tobias Klauser
<
[email protected]
>
Mon, 24 May 2010 21:33:30 +0000
(14:33 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 25 May 2010 15:07:06 +0000
(08:07 -0700)
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 <
[email protected]
>
Acked-by: Jean Delvare <
[email protected]
>
Cc: Andy Whitcroft <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
scripts/checkpatch.pl
patch
|
blob
|
history
diff --git
a/scripts/checkpatch.pl
b/scripts/checkpatch.pl
index de0f4672cb7408a49d0c931718fff794532aa16e..bd88f11b0953d161b259e80b27d6f423b12e8b1c 100755
(executable)
--- a/
scripts/checkpatch.pl
+++ b/
scripts/checkpatch.pl
@@
-2601,6
+2601,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/ ||