summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2012-10-30 02:12:23 +0000
committerPádraig Brady <P@draigBrady.com>2012-11-04 00:49:04 +0000
commit1411022cf23d81bac8176b06008898439a2c1a59 (patch)
treea278c40679f962a4d2d9191a226d349c8ae716c4 /cfg.mk
parent5e9401800b186a3746e3b50981ac11b709d3742a (diff)
downloadcoreutils-1411022cf23d81bac8176b06008898439a2c1a59.tar.xz
build: don't rely on support for '%j' printf format
* src/factor.c (print_uintmaxes): Replace with PRIuMAX. * src/join.c (check_order): Likewise. * cfg.mk (sc_check-j-printf-format): Add a syntax-check rule to flag new cases of this.
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 362b0603a..46652b017 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -191,6 +191,16 @@ sc_check-I18N-AUTHORS:
'$$(LIBICONV)' 1>&2; exit 1; }; \
done
+# Ensure %j is not used for intmax_t as it's not universally supported.
+# There are issues on HPUX for example. But note that %ju was used between
+# coreutils 8.13 (2011-10) and 8.20 (2012-10) without any reported issue,
+# and the particular issue this check is associated with was for %*jx.
+# So we may be able to relax this restriction soon.
+sc_prohibit-j-printf-format:
+ @cd $(srcdir)/src && GIT_PAGER= git grep -n '%[0*]*j[udx]' *.c \
+ && { echo '$(ME): Use PRI*MAX instead of %j' 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