-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Designated initializer for struct with embedded struct shows missing field #2363
Comments
Thanks for reporting this. It's a bug/deficiency with our parser in gcc/clang mode (msvc-mode works, but that assumes you're using cl.exe to compile, so you wouldn't want to use that). I've requested a bug report be filed for this. |
That code doesn't build with the "normal" gcc compilers (see https://gcc.godbolt.org/ ), but it does compile with the mingw64 and strawberryperl...do you happen to know what default flags are being used with that version of gcc that could lead to the different compilation behavior? I assume they're enabling some gcc extension by default? I'm trying to figure out how to get the other gcc compilers to compile that code. |
Figured it out -- the gcc mingw-64 compiler has -fms-extensions enabled by default (using -fno_ms_extensions gets the compiler to fail). I'm still investigating a potential workaround... |
Adding "--ms_extensions" to the msvc.64.intel.clang.json file (next to the binary, i.e. e.g. it should look like:
|
Thanks for investigating the issue. I wasn't aware that this syntax is not part of the c standard. It's nice that the cpptools might support it in the future anyway. |
Should I close the issue as it's looks more like a feature request now (support for ms extensions in the gcc compiler)? |
Adding support for -fms-extensions and -fno-ms-extensions args to the compilerPath and respecting mingw's default of -fms-extensions has already been implemented and should be in our next release. You can close the issue if you want or keep it open and we'll close it when we ship 0.17.8. |
Fixed with 0.18.0. |
Type: LanguageService
Designated initializer for struct with embedded struct shows missing field but shouldn't.
To Reproduce
Save following code as c file:
Shown message:

The code compiles and runs though.
Expected behavior
No missing field message shown.
The text was updated successfully, but these errors were encountered: