[Fortran f951, C++14] Fix trans-common.c compilation failure on AIX

David Edelsohn dje.gcc@gmail.com
Thu Jul 2 20:20:00 GMT 2015


After the change to C++14, Fortran trans-common.c fails to compile on
AIX due to function declaration conflicts in unistd.h.

Tobias previously added use of std::map to trans-common.c and included
<map> first in the source file, before any GCC configuration headers.
<map> inherently includes various system header files before GCC
system.h and config.h have defined macros affecting system header
files, causing later conflicts when other system header files are
included.

This patch switches the order of inclusion for trans-common.c to
include <map> last, after system.h, config.h and other GCC headers, as
it is included in other GCC source files.

Bootstrapped on powerpc-ibm-aix7.1.0.0

Okay?

Thanks, David

* trans-common.c: Include <map> last.

Index: trans-common.c
===================================================================
--- trans-common.c      (revision 225349)
+++ trans-common.c      (working copy)
@@ -92,7 +92,6 @@
    is examined for still-unused equivalence conditions.  We create a
    block for each merged equivalence list.  */

-#include <map>
 #include "config.h"
 #include "system.h"
 #include "coretypes.h"
@@ -109,6 +108,7 @@
 #include "trans-types.h"
 #include "trans-const.h"
 #include "target-memory.h"
+#include <map>


 /* Holds a single variable in an equivalence set.  */



More information about the Gcc-patches mailing list