From: Pádraig Brady
Date: Sat, 12 Aug 2023 10:21:50 +0000 (+0100) Subject: maint: allow use of printf C99 integer size specifiers X-Git-Tag: v9.4~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f31229ebd1b339b85d54c24e3b79a8262b3202d2;p=thirdparty%2Fcoreutils.git maint: allow use of printf C99 integer size specifiers 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. --- diff --git a/cfg.mk b/cfg.mk index 630251b657..6db0daf711 100644 --- 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.