
this function is working fine in java files

The C++ extension doesn't implement syntax checking during editing yet.
@sean-mcmanus Thanks man, do you guys have any plans for this feature?
Yes, we plan to enable this.
You could keep this issue open until the feature is added if you want.
@dustookk I would love this to be kept open. I anxiously await on-the-fly syntax checking, it's easily the biggest missing component when compared to Emacs / Vim / Visual Studio.
@andschwa You got it man LOL
v0.11.0 supports continuous syntax checking. It is not on by default yet, but you can enable it by adding the C_Cpp.intelliSenseEngine: "Default" property to your settings.json file. Try it out and let us know what you think!
If you have any issues with it or suggestions on how to make it better, please create a new issue so we can track it. There are a few bugs with multi-byte characters and editing on the last line of the file that we know about, so you can expect fixes for those later, but we have tried it out on a number of projects large and small and are getting good enough results to feel comfortable publishing a preview of it for those willing to try it out.
Setting this property does not cause VSCode to notice any syntax errors. What else could the problem be?
@themightyoarfish What does your Problems window show? It could be falling back to the Tag Parser.
@sean-mcmanus It does say something like that completions will be provided by the tag parser (don't remember the exact message right now).
@bobbrow I need Live syntax checker when I editing C/C++ files,
I had install many extensions, but no one has syntax check on C/C++
Yes, we plan to enable this.
@EECSGEEK, we have had live syntax checking for some time now. Make sure C_Cpp.intelliSenseEngine: "Default" is set in your settings. Also make sure that there are no green squiggles under your #include lines. If we can't resolve a #include line, we will hide the red squiggles by default.
@bobbrow My settings is ok, but still no Live syntax check
@EECSGEEK It would be better if you filed a new issue. This issue was for the original feature, which in general works for most people. I assume C_Cpp.errorSquiggles is set to Enabled. Do you see messages in your Problems window? Are you using VS Code Insiders? Can you set your C_Cpp.loggingLevel to Information and see if the C/C++ Output pane shows any useful diagnostic information?
Are there warnings for the C++ files?
For example, in Eclipse, the below code (setting a variable inside an if statement) would trigger a warning:

However, in VS Code it does not.
I'm sure that syntax checking is working, because it _does_ detect this:

Are there any plans to add the warnings, or is there a way to enable them right now?
Thanks!
@aditya-ramabadran We have warnings available as a hidden feature via removing the line with "--no_warnings" from the extension's bin\msvc.json file, but assignments in "if" statements currently do not generate a warning. If you're using the cl.exe compiler, you can use the build flag /Wall to get a warning at build time: "warning C4706: assignment within conditional expression". gcc/clang might also have such a warning level.
@aditya-ramabadran We have warnings available as a hidden feature via removing the line with "--no_warnings" from the extension's
bin\msvc.jsonfile, but assignments in "if" statements currently do not generate a warning. If you're using the cl.exe compiler, you can use the build flag /Wall to get a warning at build time: "warning C4706: assignment within conditional expression". gcc/clang might also have such a warning level.
Will it be possible in the future to be able to config this "--no_warning" flag in the C_cpp_extension's configuration ?
@X-Wei Yeah, we have warning enabling almost done (we just wanted to add a setting to enable particular warnings to be disabled before we turn it on), and that work has been post-poned (see https://github.com/Microsoft/vscode-cpptools/milestone/26 ) in favor of shipping IntelliSense-based Go to Definition sooner.
Most helpful comment
Yes, we plan to enable this.