Intellisense in Visual Studio 2010 interprets C code as C++ and marks errors where they don’t exist, as in:
struct my_struct *s = malloc(sizeof *s);
which is valid C, but not valid C++.
Is there any way to fix this?
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.
It is a known bug since at least MSVC 2005. Unfortunately it has become a bigger issue in 2010 since VC now uses Intellisense to mark errors.
See this discussion at the MSDN forums for more information. The following statement is disheartening, but I highly recommend that you add your voice to the conversation in the hopes that they may address the issue some day.
Note that you can disable Intellisense’s error reporting in Tools → Options… → Text Editor → C/C++ → Advanced → Intellisense → Disable Error Reporting → True. Of course, this really stinks if you’re in a mixed solution or simply want to include an
extern "C"header that throws Intellisense errors.