aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2025-04-19 19:22:37 -0700
committerPaul Eggert2025-04-19 19:31:26 -0700
commite2fb12a40ca2b90dfedbfe916ed8a87345ca89f1 (patch)
tree888deb6e13ef34c63719b0969d3464066d05e420 /src
parent67ae1790088616777b352acffc63aeeb7ee50cb6 (diff)
downloademacs-e2fb12a40ca2b90dfedbfe916ed8a87345ca89f1.tar.gz
emacs-e2fb12a40ca2b90dfedbfe916ed8a87345ca89f1.zip
Pacify GCC 15 -Wunterminated-string-initialization
* src/fns.c (hexbuf_digest): * src/json.c (json_out_string): Add ATTRIBUTE_NONSTRING to character arrays that are not strings.
Diffstat (limited to 'src')
-rw-r--r--src/fns.c2
-rw-r--r--src/json.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/fns.c b/src/fns.c
index 52f667a72a5..21916b6fb46 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -6014,7 +6014,7 @@ hexbuf_digest (char *hexbuf, void const *digest, int digest_size)
6014 6014
6015 for (int i = digest_size - 1; i >= 0; i--) 6015 for (int i = digest_size - 1; i >= 0; i--)
6016 { 6016 {
6017 static char const hexdigit[16] = "0123456789abcdef"; 6017 static char const hexdigit[16] ATTRIBUTE_NONSTRING = "0123456789abcdef";
6018 int p_i = p[i]; 6018 int p_i = p[i];
6019 hexbuf[2 * i] = hexdigit[p_i >> 4]; 6019 hexbuf[2 * i] = hexdigit[p_i >> 4];
6020 hexbuf[2 * i + 1] = hexdigit[p_i & 0xf]; 6020 hexbuf[2 * i + 1] = hexdigit[p_i & 0xf];
diff --git a/src/json.c b/src/json.c
index beac242b709..44eae653eb5 100644
--- a/src/json.c
+++ b/src/json.c
@@ -323,7 +323,7 @@ json_out_string (json_out_t *jo, Lisp_Object str, int skip)
323{ 323{
324 /* FIXME: this code is slow, make faster! */ 324 /* FIXME: this code is slow, make faster! */
325 325
326 static const char hexchar[16] = "0123456789ABCDEF"; 326 static const char hexchar[16] ATTRIBUTE_NONSTRING = "0123456789ABCDEF";
327 ptrdiff_t len = SBYTES (str); 327 ptrdiff_t len = SBYTES (str);
328 json_make_room (jo, len + 2); 328 json_make_room (jo, len + 2);
329 json_out_byte (jo, '"'); 329 json_out_byte (jo, '"');