I'm working in gcc 4.8.1 and I have a question about its handling of POD/aggregate initialization. What I have is some plain C-like struct:
struct S
{
//....
};
which doesn't have any user-defined default-constructor.
But due to -Wall -Wextra being set for compilation, using syntax like:
S s = {};
or
S s; s = {};
generates warnings like:
warning: missing initializer for member 'one-of-S-members' [-Wmissing-field-initializers
Colleagues are using syntax like:
S s = S();
or
S s; s = S();
And, which is total suprise for me:
- There are no warnings
- What is even more confusing this properly initializes the structure just like aggregate syntax.
So the question is - is this some gcc-specific quirk?
The code is compiled with -std=c++11