This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [Fortran f951, C++14] Fix trans-common.c compilation failure on AIX


On Thu, Jul 2, 2015 at 4:32 PM, Jakub Jelinek <jakub@redhat.com> wrote:
> 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.

graphite-isl-ast-to-gimple.c includes <map> last.

auto-profile.c includes it after system.h.

I can change the patch to include it after system.h, if that is
preferred.  That order also works on AIX.

Thanks, David


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