From 322530bd433996f8a4f2086c0229facf41c6c709 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 12 Aug 2023 11:21:50 +0100 Subject: [PATCH] maint: allow use of printf C99 integer size specifiers Older systems that had issues with these like HPUX and Solaris 8 are no longer supported, or can 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 | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/cfg.mk b/cfg.mk index 630251b65..6db0daf71 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. -- 2.41.0