diff options
Diffstat (limited to 'scripts/checkpatch.pl')
| -rwxr-xr-x | scripts/checkpatch.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 696254eee78b..8a577aa03bc6 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
| @@ -4671,6 +4671,15 @@ sub process { | |||
| 4671 | } | 4671 | } |
| 4672 | } | 4672 | } |
| 4673 | 4673 | ||
| 4674 | # Check for __attribute__ weak, or __weak declarations (may have link issues) | ||
| 4675 | if ($^V && $^V ge 5.10.0 && | ||
| 4676 | $line =~ /(?:$Declare|$DeclareMisordered)\s*$Ident\s*$balanced_parens\s*(?:$Attribute)?\s*;/ && | ||
| 4677 | ($line =~ /\b__attribute__\s*\(\s*\(.*\bweak\b/ || | ||
| 4678 | $line =~ /\b__weak\b/)) { | ||
| 4679 | ERROR("WEAK_DECLARATION", | ||
| 4680 | "Using weak declarations can have unintended link defects\n" . $herecurr); | ||
| 4681 | } | ||
| 4682 | |||
| 4674 | # check for sizeof(&) | 4683 | # check for sizeof(&) |
| 4675 | if ($line =~ /\bsizeof\s*\(\s*\&/) { | 4684 | if ($line =~ /\bsizeof\s*\(\s*\&/) { |
| 4676 | WARN("SIZEOF_ADDRESS", | 4685 | WARN("SIZEOF_ADDRESS", |
