[1/6] Introduce __decl_is_flex_array macro
Checks
Context |
Check |
Description |
redhat-pt-bot/TryBot-apply_patch |
success
|
Patch applied to master at the time it was sent
|
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 |
fail
|
Testing failed
|
Commit Message
Currently it is not possible to safely build user code
with GCC-13 -fstrict-flex-arrays due to the library
use of legacy fake flexible arrays and zero-length array gcc extension.
This commit introduces a __decl_is_flex_array macro intended to
grandfather-in this uses without modifying the relevant definitions.
Signed-off-by: Cristian Rodríguez <cristian@rodriguez.im>
---
misc/sys/cdefs.h | 6 ++++++
1 file changed, 6 insertions(+)
@@ -720,4 +720,10 @@ _Static_assert (0, "IEEE 128-bits long double requires redirection on this platf
# define __attribute_returns_twice__ /* Ignore. */
#endif
+#if __glibc_has_attribute (__strict_flex_array__)
+#define __decl_is_flex_array __attribute__ ((__strict_flex_array__(0)))
+#else
+#define __decl_is_flex_array
+#endif
+
#endif /* sys/cdefs.h */