This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: libstdc++ test case ext/headers.cc failed on arm-none-eabi


On 7 August 2013 12:20, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 7 August 2013 12:08, Florian Weimer wrote:
>> On 08/07/2013 01:05 PM, Jonathan Wakely wrote:
>>
>>> There's not enough context to see what happened, the diagnostic is
>>> crap, only showing the macro not where it's used.  The macro is not
>>> used as a non-static data member initializers except in C++11 mode, so
>>> I don't know how that could happen.
>>
>>
>> I think it's used in C++98 mode, too, but we suppress the error because it's
>> a system header.
>
> Yep, as I realised just after I sent my reply.
>
> I suspect what's happening is that gthr-default.h is getting included
> before a #pragma GCC system_header, so that when the
> __GTHREAD_MUTEX_INIT is later used (in a system header) it's treated
> as not coming from a system header e.g.
>
> $ cat g.h
> typedef int __gthread_mutex_t;
> #define INIT 0
>
> $ cat m.h
> #include "g.h"
> #pragma GCC system_header
>
>   class __mutex
>   {
>   private:
>
>     __gthread_mutex_t _M_mutex = INIT;
>
>   public:
>     __mutex() { }
>   };
>
>
> $ cat m.cc
> #include "m.h"
>
> int main()
> {
>     __mutex m;
> }
>
> $ g++  m.cc
> In file included from m.h:1:0,
>                  from m.cc:1:
> g.h:2:14: warning: non-static data member initializers only available
> with -std=c++11 or -std=gnu++11 [enabled by default]
>  #define INIT 0
>               ^

Yep, <ext/atomicity.h> doesn't have the #pragma


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