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/10/17 15:24 +0200, Florian Weimer wrote:
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.

Even though both definitions are identical?

I think there's no redefinition warning for:

#define __USE_ISOC99 1
#define __USE_ISOC99 1

Only if the macro's replacement-list differs on the redefinition.

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

Thanks. Here's an updated patch against current master, with the fixed
indentation.

Tested again on x86_64-pc-linux-gnu (Fedora 26).


Attachment: 0001-BZ-21326-Ensure-C99-and-C11-interfaces-are-available.patch
Description: Text document


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