'Undefined objects are not highlighted in VS2022 editor

When I work with C code (with /TC command line flag, or just renaming source file to .c), there won't be an error that an identifier is undefined until I try to build. The object name is just white in editor, and the error list is empty. Won't occur if I either rename the source file back to .cpp, or reset "Compile As" setting to default.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source