[PATCH v1 09/35] Remove dead code due to __glibc_c99_flexarr_available macro
Alejandro Colomar
alx@kernel.org
Sun Nov 9 21:53:08 GMT 2025
It's unconditionally defined as 1.
Signed-off-by: Alejandro Colomar <alx@kernel.org>
---
misc/sys/cdefs.h | 12 ------------
sysdeps/unix/sysv/linux/bits/socket.h | 6 ------
2 files changed, 18 deletions(-)
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 87c3581bb7..12b424e85c 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -352,18 +352,6 @@
# define __errordecl(name, msg) extern void name (void)
#endif
-/* Support for flexible arrays.
- Headers that should use flexible arrays only if they're "real"
- (e.g. only if they won't affect sizeof()) should test
- #if __glibc_c99_flexarr_available. */
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L && !defined __HP_cc
-# define __glibc_c99_flexarr_available 1
-#else
-/* GCC and clang support C99 flexible array members as an extension,
- even when in C89 mode or compiling C++ (any version). */
-# define __glibc_c99_flexarr_available 1
-#endif
-
/* __asm__ ("xyz") is used throughout the headers to rename functions
at the assembly language level. This is wrapped by the __REDIRECT
diff --git a/sysdeps/unix/sysv/linux/bits/socket.h b/sysdeps/unix/sysv/linux/bits/socket.h
index ac22e11c4d..66d33e8a65 100644
--- a/sysdeps/unix/sysv/linux/bits/socket.h
+++ b/sysdeps/unix/sysv/linux/bits/socket.h
@@ -289,17 +289,11 @@ struct cmsghdr
with this. */
int cmsg_level; /* Originating protocol. */
int cmsg_type; /* Protocol specific type. */
-#if __glibc_c99_flexarr_available
__extension__ unsigned char __cmsg_data[]; /* Ancillary data. */
-#endif
};
/* Ancillary data object manipulation macros. */
-#if __glibc_c99_flexarr_available
# define CMSG_DATA(cmsg) ((cmsg)->__cmsg_data)
-#else
-# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1))
-#endif
#define CMSG_NXTHDR(mhdr, cmsg) __cmsg_nxthdr (mhdr, cmsg)
#define CMSG_FIRSTHDR(mhdr) \
((size_t) (mhdr)->msg_controllen >= sizeof (struct cmsghdr) \
--
2.51.0
More information about the Libc-alpha
mailing list