Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2010 Intellisense squiggles for C code

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?

like image 665
Artefacto Avatar asked Jun 04 '10 10:06

Artefacto


1 Answers

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.

I am just following up and let you know that we won't fix this bug in next VS release/update.

If this bug affects your daily productivity severely, you can open/activate this bug with connect again.

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.

like image 67
mbauman Avatar answered Oct 04 '22 20:10

mbauman