Commit 62ec818f authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

checkpatch: emit an error when using predefined timestamp macros

Since commit fe7c36c7 ("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: default avatarJoe Perches <joe@perches.com>
Original-patch-by: default avatarRasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 46385326
...@@ -5089,6 +5089,12 @@ sub process { ...@@ -5089,6 +5089,12 @@ sub process {
} }
} }
# check for uses of __DATE__, __TIME__, __TIMESTAMP__
while ($line =~ /\b(__(?:DATE|TIME|TIMESTAMP)__)\b/g) {
ERROR("DATE_TIME",
"Use of the '$1' macro makes the build non-deterministic\n" . $herecurr);
}
# check for use of yield() # check for use of yield()
if ($line =~ /\byield\s*\(\s*\)/) { if ($line =~ /\byield\s*\(\s*\)/) {
WARN("YIELD", WARN("YIELD",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment