Hi Martin,

In short yes, it is special behavior but I'm not sure that it is intended.
Each target can opt in to *not* have -isystem implicitly wrap headers in
extern C construct. Arm target does not do anything special and thus
inherit that default behavior of implicit extern C, except when targeting
uclinux systems. It seems from [1] that it is this way for legacy reason.

[1] https://gcc.gnu.org/ml/gcc-patches/2012-06/msg01151.html

Best regards,

Thomas

On 24 January 2018 at 17:02, Kaul, Martin <martin.k...@leuze.com> wrote:

> Hi,
>
> given the following code:
>
> -- isystem_test.cpp -------------
> #include < isystem_test.h>
>
> bool dummy_function( void )
> {
>         return false;
> }
> -----------------------------------------
>
> -- isystem_test.h ------------------
> template <class _CS_cT>
> class allocator
> {
> };
> -----------------------------------------
>
> and g++ version: arm-eabi-g++.exe (Linaro GCC 7.2-2017.11)
>
> 1. compiling with "arm-eabi-g++ -I . -g -c isystem_test.cpp"
> --> OK
>
> 2. compiling with " arm-eabi-g++ -isystem . -g -c isystem_test.cpp "
> --> output error:
> In file included from isystem_test.cpp:3:0:
> ./isystem_test.h:3:1: error: template with C linkage
>  template <class _CS_cT>
>  ^~~~~~~~
>
> It seams that the option -isystem changes the include of isystems_test.h
> into a C include, i.e. the header content seems to be handled as C-Code
>
> Same error behavior with arm-eabi Linaro GCC 6.4-2017.11,  Linaro GCC
> 6.3-2017.05
>
> -----------------
> Testing the same with the mingw msys g++ compiler outputs no error:
> g++.exe (Rev2, Built by MSYS2 project) 7.2.0
> Copyright (C) 2017 Free Software Foundation, Inc.
> This is free software; see the source for copying conditions.  There is NO
> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> ---------------
> Also no errors for:
> arm-linux-gnueabihf-g++.exe (Linaro GCC 6.3-2017.05)
> ---------------
>
> Is there a special behavior for arm-eabi g++ compiler?
>
> Best regards
>   Martin Kaul
>
> _______________________________________________
> linaro-toolchain mailing list
> linaro-toolchain@lists.linaro.org
> https://lists.linaro.org/mailman/listinfo/linaro-toolchain
>
_______________________________________________
linaro-toolchain mailing list
linaro-toolchain@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/linaro-toolchain

Reply via email to