This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][BZ #21326] Ensure C99 and C11 interfaces are available for C++


On 09/22/2017 08:16 PM, Jonathan Wakely wrote:
+#ifdef __cplusplus
+/* This is to enable compatibility for ISO C++17.  */
+#if __cplusplus >= 201703L
+# define __USE_ISOC11	1
+#endif
  /* This is to enable compatibility for ISO C++11.

The inner #if/#endif should be indented (similar to the inner #define).

-
-   So far g++ does not provide a macro.  Check the temporary macro for
-   now, too.  */
-#if ((defined __cplusplus && __cplusplus >= 201103L)			      \
-     || defined __GXX_EXPERIMENTAL_CXX0X__)
+   Check the temporary macro for now, too.  */
+#if __cplusplus >= 201103L || defined __GXX_EXPERIMENTAL_CXX0X__
  # define __USE_ISOCXX11	1
+# define __USE_ISOC99	1
+#endif
  #endif

I think there is a preexisting issue here which will trigger macro redefinition warnings with -Wsystem-headers. But perhaps I'm mistaken.

Apart from that, the substance of the patch looks okay to me.

Thanks,
Florian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]