This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #21326] Ensure C99 and C11 interfaces are available for C++
- From: Florian Weimer <fweimer at redhat dot com>
- To: Jonathan Wakely <jwakely at redhat dot com>, Joseph Myers <joseph at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org
- Date: Mon, 9 Oct 2017 15:24:01 +0200
- Subject: Re: [PATCH][BZ #21326] Ensure C99 and C11 interfaces are available for C++
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CC68780B2A
- References: <20170922175120.GA21566@redhat.com> <alpine.DEB.2.20.1709221755590.17667@digraph.polyomino.org.uk> <20170922181627.GW4582@redhat.com>
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