Visual Studio 2010 Intellisense squiggles for C code

故事扮演 提交于 2020-01-01 04:49:07

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/2973277/visual-studio-2010-intellisense-squiggles-for-c-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!