From: Pádraig Brady Date: Tue, 1 Aug 2023 12:30:02 +0000 (+0100) Subject: od: fix issues with recent format string changes X-Git-Tag: v9.4~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=89c8c5fff30af021433139c89de389ee4af7dfc5;p=thirdparty%2Fcoreutils.git od: fix issues with recent format string changes * src/ioblksize.h: Avoid syntax check with redundant idx.h inclusion. * src/od.c (FMT_BYTES_ALLOCATED): Increase by two to avoid: error: '%s' directive writing between 1 and 2 bytes into a region of size between 1 and 4 [-Werror=format-overflow=] (maint): Use %td to print idx_t rather than invalid %jt format. --- diff --git a/src/ioblksize.h b/src/ioblksize.h index 80d7931ba8..0a24062866 100644 --- a/src/ioblksize.h +++ b/src/ioblksize.h @@ -17,7 +17,6 @@ /* Include this file _after_ system headers if possible. */ /* sys/stat.h and minmax.h will already have been included by system.h. */ -#include "idx.h" #include "count-leading-zeros.h" #include "stat-size.h" diff --git a/src/od.c b/src/od.c index 7f5cfbb22b..df7fe9eb86 100644 --- a/src/od.c +++ b/src/od.c @@ -84,7 +84,7 @@ enum output_format enum { FMT_BYTES_ALLOCATED = - (sizeof "%*.99" - 1 + (sizeof "%*.99" + 1 + MAX (sizeof "ld", MAX (sizeof PRIdMAX, MAX (sizeof PRIoMAX, @@ -1927,7 +1927,7 @@ main (int argc, char **argv) bytes_per_block = desired_width; else { - error (0, 0, _("warning: invalid width %jt; using %d instead"), + error (0, 0, _("warning: invalid width %td; using %d instead"), desired_width, l_c_m); bytes_per_block = l_c_m; }