[PATCH 2/2] (header usage fix) include c++ headers in system.h

David Edelsohn dje.gcc@gmail.com
Fri Apr 22 14:16:00 GMT 2016


On Fri, Apr 22, 2016 at 6:02 AM, Szabolcs Nagy <szabolcs.nagy@arm.com> wrote:
> Some gcc source files include standard headers after
> "system.h" but those headers may declare and use poisoned
> symbols, they also cannot be included before "system.h"
> because they might depend on macro definitions from there,
> so they must be included in system.h.
>
> This patch fixes the use of <list>, <map>, <set>, <vector>
> and <algorithm> headers, by using appropriate
> INCLUDE_{LIST, MAP, SET, VECTOR, ALGORITHM} macros.
> (Note that there are some other system header uses which
> did not get fixed.)
>
> Build tested on aarch64-*-gnu, sh-*-musl, x86_64-*-musl and
> bootstrapped x86_64-*-gnu (together with PATCH 1/2).
>
> is this ok for AIX?

It should be okay on AIX.

> OK for trunk?
>
> This would be nice to fix in gcc-6 too, because at least
> with musl libc the bootstrap is broken.
>
> gcc/ChangeLog:
>
> 2016-04-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
>
>         * system.h (list, map, set, vector): Include conditionally.
>         * auto-profile.c (INCLUDE_MAP, INCLUDE_SET): Define.
>         * graphite-isl-ast-to-gimple.c (INCLUDE_MAP): Define.
>         * ipa-icf.c (INCLUDE_LIST): Define.
>         * config/aarch64/cortex-a57-fma-steering.c (INCLUDE_LIST): Define.
>         * config/sh/sh.c (INCLUDE_VECTOR): Define.
>         * config/sh/sh_treg_combine.cc (INCLUDE_ALGORITHM): Define.
>         (INCLUDE_LIST, INCLUDE_VECTOR): Define.
>         * cp/logic.cc (INCLUDE_LIST): Define.
>         * fortran/trans-common.c (INCLUDE_MAP): Define.



More information about the Gcc-patches mailing list