]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: allow use of printf C99 integer size specifiers
authorPádraig Brady <P@draigBrady.com>
Sat, 12 Aug 2023 10:21:50 +0000 (11:21 +0100)
committerPádraig Brady <P@draigBrady.com>
Sat, 12 Aug 2023 10:32:25 +0000 (11:32 +0100)
Older systems that had issues with these like HP-UX and Solaris 8
are now obsolete, and can easily apply patches to provide support.
Also we've used %td since coreutils 9.1, with no reported issues.

* cfg.mk (sc_prohibit-c99-printf-format): Remove to allow use of
%[jtz] size specifiers, which allows for cleaner code
by avoiding the need to cast to PRI?MAX etc.

cfg.mk

diff --git a/cfg.mk b/cfg.mk
index 630251b6578cabc72d361d796bf69e8e87193e00..6db0daf71128de5b4f7c62ee01910c5ba49901ed 100644 (file)
--- a/cfg.mk
+++ b/cfg.mk
@@ -299,17 +299,6 @@ sc_check-I18N-AUTHORS:
                    '$$(LIBICONV)' 1>&2; exit 1; };                     \
          done
 
-# Disallow the C99 printf size specifiers %z and %j as they're not portable.
-# The gnulib printf replacement does support them, however the printf
-# replacement is not currently explicitly depended on by the gnulib error()
-# module for example.  Also we use fprintf() in a few places to output simple
-# formats but don't use the gnulib module as it is seen as overkill at present.
-# We'd have to adjust the above gnulib items before disabling this.
-sc_prohibit-c99-printf-format:
-       @cd $(srcdir)/src && GIT_PAGER= git grep -n '%[0*]*[jz][udx]' *.c    \
-         && { echo '$(ME): Use PRI*MAX instead of %j or %z' 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.