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

Jakub Jelinek jakub@redhat.com
Thu Jul 2 20:32:00 GMT 2015


On Thu, Jul 02, 2015 at 04:20:16PM -0400, David Edelsohn wrote:
> 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.

Generally, system headers should be included either from system.h, or
in between config.h and system.h, or right after config.h and system.h.
Including them after myriads of GCC headers risks conflicts with all the
GCC macros.

	Jakub



More information about the Gcc-patches mailing list