g++ warning

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

g++ warning

Dirk Laurie-2
The absolutely standard construction

 static const luaL_Reg funcs [] {
  {NULL,NULL}
}

raises a g++ warning.

warning: extended initializer lists only available with -std=c++11 or
-std=gnu++11 [enabled by default]

Must I worry?

Reply | Threaded
Open this post in threaded view
|

Re: g++ warning

Christian N.
On 2015-02-25 10:14 +0100, Dirk Laurie <[hidden email]> wrote:

> The absolutely standard construction
>
>   static const luaL_Reg funcs [] {
>    {NULL,NULL}
> }
>
> raises a g++ warning.
>
> warning: extended initializer lists only available with -std=c++11 or
> -std=gnu++11 [enabled by default]
>
> Must I worry?
>


You forgot the = between the [] and the {. If you leave it withouth one,
then g++ is correct: You are using C++11 uniform/brace initialization.