]> git.ipfire.org Git - thirdparty/gnulib.git/commitdiff
full-write: pacify GCC 16 -Wkeyword-macro
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 May 2026 00:09:26 +0000 (17:09 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 May 2026 02:19:04 +0000 (19:19 -0700)
* lib/full-write.c (const): Do not #define.  Instead, use CONST.
(CONST): New macro.
(full_rw): Omit unnecessary cast.

ChangeLog
lib/full-write.c

index fd8e899b9385f32c2c4870f06c458757b667ce00..079abf281f5a44cebc08b91785961963bfedbabb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2026-05-07  Paul Eggert  <eggert@cs.ucla.edu>
 
+       full-write: pacify GCC 16 -Wkeyword-macro
+       * lib/full-write.c (const): Do not #define.  Instead, use CONST.
+       (CONST): New macro.
+       (full_rw): Omit unnecessary cast.
+
        fts: pacify GCC 16 -Wfree-labels
        Evidently those FALLTHROUGHs were put in to pacify an old
        version of GCC, but that’s no longer needed and nowadays
index 46266c7b56736c032c64323921cda80f971df928..a6f87d6a4754e3143aa46b35c339129ddb997b3c 100644 (file)
 # include "safe-read.h"
 # define safe_rw safe_read
 # define full_rw full_read
-# undef const
-# define const /* empty */
+# define CONST /* empty */
 #else
 # include "safe-write.h"
 # define safe_rw safe_write
 # define full_rw full_write
+# define CONST const
 #endif
 
 #ifdef FULL_READ
    When reading, if fewer than COUNT bytes are read, you must examine
    errno to distinguish failure from EOF (errno == 0).  */
 idx_t
-full_rw (int fd, const void *buf, idx_t count)
+full_rw (int fd, void CONST *buf, idx_t count)
 {
   idx_t total = 0;
-  const char *ptr = (const char *) buf;
+  char CONST *ptr = buf;
 
   while (count > 0)
     {