[PATCH v1 07/35] intl/: Remove ZERO macro

Alejandro Colomar alx@kernel.org
Sun Nov 9 21:53:03 GMT 2025


We may want to use [], BTW, since GCC supports it since 2.97.

Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
 intl/dcigettext.c | 4 ++--
 intl/gettextP.h   | 6 +-----
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index fe5c19bf37..152ccfc94b 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -241,7 +241,7 @@ struct known_translation_t
   /* Pointer to the string in question.  */
   union
     {
-      char appended[ZERO];  /* used if domain != NULL */
+      char appended[0];     /* used if domain != NULL */
       const char *ptr;      /* used if domain == NULL */
     }
   msgid;
@@ -362,7 +362,7 @@ static const char *get_output_charset (struct binding *domainbinding);
 typedef struct transmem_list
 {
   struct transmem_list *next;
-  char data[ZERO];
+  char data[0];
 } transmem_block_t;
 static struct transmem_list *transmem_list;
 #else
diff --git a/intl/gettextP.h b/intl/gettextP.h
index 869d25051e..d7f4c56d9d 100644
--- a/intl/gettextP.h
+++ b/intl/gettextP.h
@@ -195,10 +195,6 @@ struct loaded_domain
   unsigned long int nplurals;
 };
 
-/* We want to allocate a string at the end of the struct.  But ISO C
-   doesn't allow zero sized arrays.  */
-# define ZERO 0
-
 /* A set of settings bound to a message domain.  Used to store settings
    from bindtextdomain() and bind_textdomain_codeset().  */
 struct binding
@@ -206,7 +202,7 @@ struct binding
   struct binding *next;
   char *dirname;
   char *codeset;
-  char domainname[ZERO];
+  char domainname[0];
 };
 
 /* A counter which is incremented each time some previous translations
-- 
2.51.0



More information about the Libc-alpha mailing list