1

There are similar questions here and elsewhere but none that fix this issue.

gcc 4.6.3 on Ubuntu 12.04.5 produces the following warning

extended initializer lists only available with -std=c++0x or -std=gnu++0x [enabled by default]

for the following code

// Mutex.h
class CMutex
{
    ...
private:
    pthread_mutex_t m_plock;
};

// Mutex.cpp
CMutex::CMutex()
{
    m_plock = PTHREAD_MUTEX_INITIALIZER;
}

How is this warning best resolved?

Community
  • 1
  • 1
jacknad
  • 13,483
  • 40
  • 124
  • 194

1 Answers1

2

GCC just wants you to know that you're using C++11 features (in case you didn't intend to), even if it allows them by default. To disable the warning just add the switch that it is suggesting, i.e. -std=c++0x to let it know this is indeed your intention.

Smeeheey
  • 9,906
  • 23
  • 39