|
@@ -3265,6 +3265,12 @@ sub process {
|
|
"sizeof(& should be avoided\n" . $herecurr);
|
|
"sizeof(& should be avoided\n" . $herecurr);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+# check for sizeof without parenthesis
|
|
|
|
+ if ($line =~ /\bsizeof\s+((?:\*\s*|)$Lval|$Type(?:\s+$Lval|))/) {
|
|
|
|
+ WARN("SIZEOF_PARENTHESIS",
|
|
|
|
+ "sizeof $1 should be sizeof($1)\n" . $herecurr);
|
|
|
|
+ }
|
|
|
|
+
|
|
# check for line continuations in quoted strings with odd counts of "
|
|
# check for line continuations in quoted strings with odd counts of "
|
|
if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
|
|
if ($rawline =~ /\\$/ && $rawline =~ tr/"/"/ % 2) {
|
|
WARN("LINE_CONTINUATIONS",
|
|
WARN("LINE_CONTINUATIONS",
|