summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-10-23 06:06:46 -0600
committerEric Blake <ebb9@byu.net>2009-10-23 06:29:54 -0600
commitc0dcf3238bb9341c03bdb7f73c1af1b3898de557 (patch)
tree297ff50ee909652a7e027251c9d85f8b16b282de /cfg.mk
parenta08e13a0fbd1843c06e51707dc479116187f1243 (diff)
downloadcoreutils-c0dcf3238bb9341c03bdb7f73c1af1b3898de557.tar.xz
build: prohibit improper use of stat and lstat
* cfg.mk (sc_prohibit_stat_macro_address): New rule. * src/ln.c (do_link): Adjust comment to avoid false positive. * src/stat.c (do_stat): Likewise. * src/touch.c (main): Likewise.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk6
1 files changed, 6 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index 807d3c9c4..1e5108b2d 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -197,6 +197,12 @@ sc_prohibit_readlink:
msg='do not use readlink(at); use via xreadlink or areadlink*' \
$(_prohibit_regexp)
+# Don't use address of "stat" or "lstat" functions
+sc_prohibit_stat_macro_address:
+ @re='\<l?stat '':|&l?stat\>' \
+ msg='stat() and lstat() may be function-like macros' \
+ $(_prohibit_regexp)
+
# Ensure that date's --help output stays in sync with the info
# documentation for GNU strftime. The only exception is %N,
# which date accepts but GNU strftime does not.