diff options
author | Joe Perches <joe@perches.com> | 2015-02-13 17:38:18 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-02-14 00:21:39 -0500 |
commit | 62ec818f55ccc3e1a04a6634f8e541596778af5d (patch) | |
tree | be3c61cd325d694c8a3d3e5b8d1d2f28199aa9c4 /scripts | |
parent | 46385326cc1577587ed3e7432c2425cf6d3e4308 (diff) |
checkpatch: emit an error when using predefined timestamp macros
Since commit fe7c36c7bde1 ("Makefile: Build with -Werror=date-time if
the compiler supports it"), use of __DATE__, __TIME__, and __TIMESTAMP__
has not been allowed.
As this test is gcc version specific (> 4.9), it hasn't prevented a few
new uses from creeping into the kernel sources.
Make checkpatch complain about them.
Signed-off-by: Joe Perches <joe@perches.com>
Original-patch-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/checkpatch.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index f0bb6d60c07b..501c286369c9 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -5089,6 +5089,12 @@ sub process { | |||
5089 | } | 5089 | } |
5090 | } | 5090 | } |
5091 | 5091 | ||
5092 | # check for uses of __DATE__, __TIME__, __TIMESTAMP__ | ||
5093 | while ($line =~ /\b(__(?:DATE|TIME|TIMESTAMP)__)\b/g) { | ||
5094 | ERROR("DATE_TIME", | ||
5095 | "Use of the '$1' macro makes the build non-deterministic\n" . $herecurr); | ||
5096 | } | ||
5097 | |||
5092 | # check for use of yield() | 5098 | # check for use of yield() |
5093 | if ($line =~ /\byield\s*\(\s*\)/) { | 5099 | if ($line =~ /\byield\s*\(\s*\)/) { |
5094 | WARN("YIELD", | 5100 | WARN("YIELD", |