From dd12f616285456bd3ed5877111f6fd6860b299ff Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 12 Sep 2026 14:56:07 -0700 Subject: [PATCH] tar: tell the compiler that xm_max counts xm_map A simpler alternative to a suggestion by Jeff Bindel in: https://lists.gnu.org/r/bug-tar/2026-09/msg00006.html * src/tar.h (struct xattr_map.xm_map): Move to the end, and declare with _GL_ATTRIBUTE_COUNTED_BY (xm_max). --- src/tar.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tar.h b/src/tar.h index 390f6b24..9bafa9fc 100644 --- a/src/tar.h +++ b/src/tar.h @@ -298,9 +298,9 @@ struct xattr_array struct xattr_map { - struct xattr_array *xm_map; idx_t xm_size; /* Size of the xattr map */ idx_t xm_max; /* Max. number of entries in xattr_map */ + struct xattr_array *xm_map _GL_ATTRIBUTE_COUNTED_BY (xm_max); }; struct tar_stat_info