Will this warning create any problem in runtime?
ext.h(180) : warning C4201: nonstandard extension used : nameless struct/union
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is when you have a union or struct without a name, e.g.:
It allows you to access members of the union as if they were members of the struct. When you give the union a name (which is what the standard requires), you must access
aandbthrough the name of the union instead:It is not an issue as long as you compile your code using compilers that share this extension, it is only a problem when you compile your code using compilers that don’t, and because the standard doesn’t require this behaviour, a compiler is free to reject this code.
Edit: As pointed out by andyn, C11 explicitly allows this behaviour.