summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2013-02-19 10:58:51 +0000
committerPádraig Brady <P@draigBrady.com>2013-02-20 04:04:25 +0000
commit31861f663a440df498bdb7788fa43aa9d03133c5 (patch)
tree358f12f0f419f7471ac38aa788fd5adba68e03b0 /cfg.mk
parent04b035670de49429d48dea726125caa613c1629f (diff)
downloadcoreutils-31861f663a440df498bdb7788fa43aa9d03133c5.tar.xz
maint: cleanup up various uses of __attribute__
* src/cfg.mk (sc_prohibit-gl-attributes): Disallow the __attribute() form without trailing underscores as that is not elided where required. Also ensure we use gnulib macros rather than defining our own. * src/system.h: Remove gnulib provided macros. * src/chown-core.c: Likewise. * src/chroot.c: Likewise. * src/copy.c: Likewise. * src/csplit.c: Likewise. * src/dd.c: Likewise. * src/expr.c: Likewise. * src/extent-scan.c: Likewise. * src/factor.c: Likewise. * src/ls.c: Likewise. * src/od.c: Likewise. * src/paste.c: Likewise. * src/ptx.c: Likewise. * src/sort.c: Likewise. * src/stat.c: Likewise. * src/stty.c: Likewise. * src/system.h: Likewise. * src/tac.c: Likewise. * src/test.c: Likewise. * src/tsort.c: Likewise.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk10
1 files changed, 10 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index c9952d2c0..6fa7b1f72 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -201,6 +201,16 @@ sc_prohibit-j-printf-format:
&& { echo '$(ME): Use PRI*MAX instead of %j' 1>&2; exit 1; } \
|| :
+# Ensure the alternative __attribute (keyword) form isn't used as
+# that form is not elided where required. Also ensure that we don't
+# directly use attributes already defined by gnulib.
+# TODO: move the check for _GL... attributes to gnulib.
+sc_prohibit-gl-attributes:
+ @cd $(srcdir) && GIT_PAGER= git grep -En \
+ "__attribute |__(unused|pure|const)__" src gl/lib/*.[ch] \
+ && { echo '$(ME): Use _GL... attribute macros' 1>&2; exit 1; } \
+ || :
+
# Look for lines longer than 80 characters, except omit:
# - program-generated long lines in diff headers,
# - tests involving long checksum lines, and