diff options
| author | Jim Meyering <meyering@meta.com> | 2025-04-06 07:55:04 -0700 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2025-04-07 18:47:43 +0100 |
| commit | 42f6201aa554fde4c78a3c5d0207d85392eb742e (patch) | |
| tree | 7a91030d78722ae01773b0086ed6f51811e374a6 | |
| parent | maint: avoid syntax-check failures from recent commit (diff) | |
| download | coreutils-42f6201aa554fde4c78a3c5d0207d85392eb742e.tar.gz coreutils-42f6201aa554fde4c78a3c5d0207d85392eb742e.zip | |
build: use _GL_ATTRIBUTE_NONSTRING attribute to avoid new warnings
Avoid warnings like this from GCC 15:
src/basenc.c:1139:20: error: initializer-string for array of 'char'
truncates NUL terminator but destination lacks 'nonstring' attribute
(9 chars into 8 available) [-Werror=unterminated-string-initialization]
* src/basenc.c (z85_encoding, do_decode): Mark two more variables as
non-terminated.
| -rw-r--r-- | src/basenc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basenc.c b/src/basenc.c index 099c25bcb..de1070b44 100644 --- a/src/basenc.c +++ b/src/basenc.c @@ -711,7 +711,7 @@ isuz85 (unsigned char ch) return c_isalnum (ch) || strchr (".-:+=^!/*?&<>()[]{}@%$#", ch) != nullptr; } -static char const z85_encoding[85] = +static char const z85_encoding[85] _GL_ATTRIBUTE_NONSTRING = "0123456789" "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" @@ -1136,7 +1136,7 @@ do_decode (FILE *in, char const *infile, FILE *out, bool ignore_garbage) idx_t sum; struct base_decode_context ctx; - char padbuf[8] = "========"; + char padbuf[8] _GL_ATTRIBUTE_NONSTRING = "========"; inbuf = xmalloc (BASE_LENGTH (DEC_BLOCKSIZE)); outbuf = xmalloc (DEC_BLOCKSIZE); |
