Bug: Intellisense believes itself in C++ while working on a C file.

Locked Bug: Intellisense believes itself in C++ while working on a C file.

  • Friday, February 26, 2010 11:43 AM
     
     
    Hi,
    This bug has been present at least since 2005, but has become prominent with the 2010 version due to now displaying error messages.

    Basically, when you're working on a C source file, Intellisense still believe you're in C++. You can see that easily from 2005 onwards with a simple #ifdef __cplusplus which will reveal the problem. Of course, in 2005 it's harmless. But it has taken a new dimension with error messages.

    In C, it's legal to assign a void pointer to a typed pointer without an explicit cast. In C++, this is illegal. So, when used (legally!) in a C file, Intellisense shows spurious error messages:
    • 1 IntelliSense : a value of type "void *" cannot be assigned to an entity of type "int *" c:\users\nicolas\documents\visual studio 10\projects\cprog\cprog\program.c 13 4 CProg

All Replies

  • Friday, February 26, 2010 5:30 PM
     
     

    Hi Medinoc,

    Have you tried to change the "Properties->C/C++->Advanced->Compile As" option to be "Compile as C Code (/TC)"?
    Does that solve your problem?

    Thanks,
    Jianhua

  • Monday, March 08, 2010 2:10 PM
     
     
    Hi,

    I don't actually have Visual 2010 myself, but I just tried in 2005 (you know, the #ifdef __cplusplus highlighting) and it turned out that the option was already /TC for my C files.
    So, it appears that Intellisense ignores this setting.

    Note that the actual compilation is just fine: The problem is in Intellisense only.
  • Tuesday, March 09, 2010 3:33 AM
     
     
    Hi Medinoc,

    The problem you reported is indeed a product issue.
    I have opened a bug for it and I will keep you updated.

    Thanks,
    Jianhua
  • Tuesday, March 09, 2010 3:19 PM
     
     
    Thanks to you as well.
  • Thursday, April 22, 2010 11:44 PM
     
     

    Hi Medinoc,

    Our team is fixing various bugs and currently this bug is not meeting our bug fix bar for next VS product update.

    We want to evaluate the impact of this bug to your development productivity and want to hear from you further comments on this bug.

    Thanks,

    Jianhua

     

  • Friday, April 23, 2010 4:59 AM
     
     

    Well, personally I'm not very impacted by this bug, as I don't use Visual Studio 2010.

    In the 2005 and 2008 versions, the bug's effects are minimal.

  • Wednesday, April 28, 2010 8:21 PM
     
     

    Hi Medinoc,

    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.

    Thanks,

    Jianhua 

  • Thursday, May 27, 2010 4:29 PM
     
     
    I am recently working on a pure C project on Visual Studio 2010 and really can't effectively work with that bug. My Error List shows hundreds of errors, but the project compiles without problems. Most errors arise from the "#ifdec __cplusplus" in (for example) the DirectX headers. I would be pleased if there's a working solution...