[03/13] RFC: ldbl-128ibm-compat: workaround C++ redirect limitations
Commit Message
GCC 8+ is more pedantic about type checking the redirect declarations
for non-system headers. I am not sure if there is less obtrusive way
to dodge these warnings when building C++ tests using the headers from
the glibc under construction.
Does a better option than explicitly specifying these headers via
the #pragma GCC system_header?
---
include/monetary.h | 8 ++++++++
include/printf.h | 8 ++++++++
include/stdio.h | 10 ++++++++++
include/stdlib.h | 9 +++++++++
include/wchar.h | 9 +++++++++
5 files changed, 44 insertions(+)
Comments
"Paul E. Murphy" <murphyp@linux.vnet.ibm.com> writes:
> GCC 8+ is more pedantic about type checking the redirect declarations
> for non-system headers. I am not sure if there is less obtrusive way
> to dodge these warnings when building C++ tests using the headers from
> the glibc under construction.
>
> Does a better option than explicitly specifying these headers via
> the #pragma GCC system_header?
I'm afraid -isystem is not an option in this case as it could change the
lookup order. In other words: I don't have a better option than
what you proposed.
@@ -1,3 +1,11 @@
+/* This is needed to keep GCC >= 9 happy when using redirects inside system
+ headers. glibc builds some C++ tests which use these headers which do
+ not get marked as system headers. */
+#include <bits/floatn.h>
+#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1
+# pragma GCC system_header
+#endif
+
#include <stdlib/monetary.h>
#ifndef _ISOMAC
#include <stdarg.h>
@@ -1,5 +1,13 @@
#ifndef _PRINTF_H
+/* This is needed to keep GCC >= 9 happy when using redirects inside system
+ headers. glibc builds some C++ tests which use these headers which do
+ not get marked as system headers. */
+#include <bits/floatn.h>
+#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1
+# pragma GCC system_header
+#endif
+
#include <stdio-common/printf.h>
# ifndef _ISOMAC
@@ -2,8 +2,18 @@
# if !defined _ISOMAC && defined _IO_MTSAFE_IO
# include <stdio-lock.h>
# endif
+
+/* This is needed to keep GCC >= 9 happy when using redirects inside system
+ headers. glibc builds some C++ tests which use these headers which do
+ not get marked as system headers. */
+# include <bits/floatn.h>
+# if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1
+# pragma GCC system_header
+# endif
+
# include <libio/stdio.h>
# ifndef _ISOMAC
+
# define _LIBC_STDIO_H 1
# include <libio/libio.h>
@@ -3,6 +3,15 @@
#ifndef _ISOMAC
# include <stddef.h>
#endif
+
+/* This is needed to keep GCC >= 9 happy when using redirects inside system
+ headers. glibc builds some C++ tests which use these headers which do
+ not get marked as system headers. */
+#include <bits/floatn.h>
+#if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1
+# pragma GCC system_header
+#endif
+
#include <stdlib/stdlib.h>
/* Now define the internal interfaces. */
@@ -1,4 +1,13 @@
#ifndef _WCHAR_H
+
+/* This is needed to keep GCC >= 9 happy when using redirects inside system
+ headers. glibc builds some C++ tests which use these headers which do
+ not get marked as system headers. */
+# include <bits/floatn.h>
+# if defined __cplusplus && __LONG_DOUBLE_USES_FLOAT128 == 1
+# pragma GCC system_header
+# endif
+
# include <wcsmbs/wchar.h>
# ifndef _ISOMAC