diff mbox

C++ PATCH to change default dialect to C++14

Message ID CABXYE2Wi9Bd2p6Y+WUfb2GZK9=owzRg-O0bqZ9LV01QEMRGOHA@mail.gmail.com
State New
Headers show

Commit Message

Jim Wilson July 2, 2015, 6:17 a.m. UTC
On Wed, Jul 1, 2015 at 10:21 PM, Jason Merrill <jason@redhat.com> wrote:
> This document also says that "A workaround until libraries get updated is to
> include <cstddef> or <stddef.h> before any headers from that library."
> Can you try modifying the graphite* files accordingly?

Right.  I forgot to try that.  Trying it now, I see that my build gets
past the point that it failed, so this does appear to work.  I won't
be able to finish a proper test until tomorrow, but for now this patch
seems to work.

Jim

Comments

Jim Wilson July 2, 2015, 11:41 p.m. UTC | #1
On 07/01/2015 11:17 PM, Jim Wilson wrote:
> On Wed, Jul 1, 2015 at 10:21 PM, Jason Merrill <jason@redhat.com> wrote:
>> This document also says that "A workaround until libraries get updated is to
>> include <cstddef> or <stddef.h> before any headers from that library."
>> Can you try modifying the graphite* files accordingly?
> 
> Right.  I forgot to try that.  Trying it now, I see that my build gets
> past the point that it failed, so this does appear to work.  I won't
> be able to finish a proper test until tomorrow, but for now this patch
> seems to work.

Since the patch to include system.h before the isl header did not work,
I went ahead and tested this patch to add stddef.h includes before the
isl headers.  I tested it with an x86_64 bootstrap and make check.
There were no problems caused by my patch.

Though as a side effect of doing this, I discovered another minor
problem with the C++ version change.  This caused one additional
testsuite failure.  It also caused a bunch of tests to start working,
which is nice, but the new failure needs to be addressed.

/home/wilson/FOSS/GCC/gcc-svn/gcc/testsuite/gcc.dg/plugin/wide-int_plugin.
c: In function 'void test_double_int_round_udiv()':
/home/wilson/FOSS/GCC/gcc-svn/gcc/testsuite/gcc.dg/plugin/wide-int_plugin.
c:13:45: error: narrowing conversion of '-1' from '
int' to 'long unsigned int' inside { } [-Wnarrowing]
   double_int dmax = { -1, HOST_WIDE_INT_MAX };
                                             ^
/home/wilson/FOSS/GCC/gcc-svn/gcc/testsuite/gcc.dg/plugin/wide-int_plugin.
c:14:33: error: narrowing conversion of '-1' from '
int' to 'long unsigned int' inside { } [-Wnarrowing]
   double_int dnegone = { -1, -1 };
                                 ^
...
FAIL: gcc.dg/plugin/wide-int_plugin.c compilation

The code compiles with -std=c++98.  It does not compile with -std=c++14.
 So this testcase should be fixed to work with c++14.  Or the c++14
support should be fixed if it is broken.

Jim
diff mbox

Patch

2015-07-01  Jim Wilson  <jim.wilson@linaro.org>

	* graphite-blocking.c (HAVE_isl): Include <stddef.h>.
	* graphite-dependencies.c, graphite-interchange.c,
	graphite-isl-ast-to-gimple.c, graphite-optimize-isl.c, graphite-poly.c,
	graphite-scop-detection.c, graphite-sese-to-poly.c, graphite.c:
	Likewise.

Index: graphite-blocking.c
===================================================================
--- graphite-blocking.c	(revision 225286)
+++ graphite-blocking.c	(working copy)
@@ -24,6 +24,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/union_map.h>
Index: graphite-dependences.c
===================================================================
--- graphite-dependences.c	(revision 225286)
+++ graphite-dependences.c	(working copy)
@@ -22,6 +22,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/union_map.h>
Index: graphite-interchange.c
===================================================================
--- graphite-interchange.c	(revision 225286)
+++ graphite-interchange.c	(working copy)
@@ -24,6 +24,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/aff.h>
 #include <isl/set.h>
 #include <isl/map.h>
Index: graphite-isl-ast-to-gimple.c
===================================================================
--- graphite-isl-ast-to-gimple.c	(revision 225286)
+++ graphite-isl-ast-to-gimple.c	(working copy)
@@ -21,6 +21,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/union_map.h>
Index: graphite-optimize-isl.c
===================================================================
--- graphite-optimize-isl.c	(revision 225286)
+++ graphite-optimize-isl.c	(working copy)
@@ -21,6 +21,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/union_map.h>
Index: graphite-poly.c
===================================================================
--- graphite-poly.c	(revision 225286)
+++ graphite-poly.c	(working copy)
@@ -22,6 +22,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/union_map.h>
Index: graphite-scop-detection.c
===================================================================
--- graphite-scop-detection.c	(revision 225286)
+++ graphite-scop-detection.c	(working copy)
@@ -22,6 +22,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/union_map.h>
Index: graphite-sese-to-poly.c
===================================================================
--- graphite-sese-to-poly.c	(revision 225286)
+++ graphite-sese-to-poly.c	(working copy)
@@ -21,6 +21,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/union_map.h>
Index: graphite.c
===================================================================
--- graphite.c	(revision 225286)
+++ graphite.c	(working copy)
@@ -35,6 +35,9 @@  along with GCC; see the file COPYING3.
 #include "config.h"
 
 #ifdef HAVE_isl
+/* Workaround for GMP 5.1.3 bug, see PR56019.  */
+#include <stddef.h>
+
 #include <isl/set.h>
 #include <isl/map.h>
 #include <isl/options.h>