Hi,

On 09/10/2014 04:39 PM, Hi-Angel wrote:
Below is a sample code to test. GCC with the option allegedly says
that the line «obj = {0};» isn't initializes «mystruct::b» member to
anything, although it really is.

struct mystruct{
         int a;
         int b[2];
};

int main(){
         mystruct obj = {1,{2,3}};
         printf("%i\n", obj.b[1]);
         obj = {0};
         printf("%i\n", obj.b[1]);
         return 0;
}

A bug?
I don't see anything wrong with the warning vs your snippet. You may want to read the audit trail of Bug c++/61489 for clarifications.

Paolo.

Reply via email to