Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Intellisense/Code parser error (Read 5317 times)
Mogollon
Newbies
*
Offline


Posts: 6
Location: Ottawa, Canada
Joined: Oct 10th, 2012
Intellisense/Code parser error
Oct 15th, 2012 at 3:12pm
Print Post  
Hi, awesome job with this pluging.

I'm getting an error mark on Visual Studio IDE when I work with enumerators.

It doesn't show an error on the error list but I can see this red wave mark below the equal operator in my code, and says "Error: a value of type "mStatus" cannot be assigned to an entity of type "mStatus"

The code compiles and upload to the arduino board without problem, but it's annoying getting this red mark on this line of code. 

Maybe I'm doing something wrong?

The red mark appear below the equal sign of the following line:
myStatus = INITIALIZING;

here is the sample:

Code
Select All
enum mStatus {
	INITIALIZING,
	WARMINGUP,
	READY,
	RUNNING,
	STOPPED
};

volatile mStatus myStatus;

void setup()
{

	/* add setup code here */
	myStatus = INITIALIZING;
}

void loop()
{

  /* add main program code here */

}
 



I'm using Visual Studio 2010 10.0 SP1
Arduino 1.0.1 software
Mega 2560 board
« Last Edit: Oct 15th, 2012 at 3:14pm by Mogollon »  
Back to top
GTalkSkype/VoIP  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense/Code parser error
Reply #1 - Oct 15th, 2012 at 3:35pm
Print Post  
Yep I get that. We are using the VC++ intellisense system which isn't a 100% perfect fit.

Having said that we have some limited control to improve it but my C++ isn't good enough.

If you can make any recommendations based on the following it would be appreciated:-

1) There might be certain vs intellisense, link and/or compiler switches/defines that Visual Studio supports to disable certain warnings. 

2) I notice that error disappears if myStatus is defined as int instead of mStatus. I am not suggesting you  make this change but wonder if vm can automatically add any "hidden" typedefs or defines to fix this type of problem. "Hidden" commands are ones that vm can ensure only apply to visual studio project intellisense (not the real source compile)

Any suggestions or observations will be appreciated
  
Back to top
IP Logged
 
Mogollon
Newbies
*
Offline


Posts: 6
Location: Ottawa, Canada
Joined: Oct 10th, 2012
Re: Intellisense/Code parser error
Reply #2 - Oct 15th, 2012 at 4:12pm
Print Post  
It's difficult for me to suggest something, I learning C++ too.

However I will do my work and look at some of your suggestions to get any idea to you.

I will update this post with my findings (if any).

Anyone with more ideas?
  
Back to top
GTalkSkype/VoIP  
IP Logged
 
Madz
Newbies
*
Offline


Posts: 2
Location: Australia
Joined: Feb 14th, 2013
Re: Intellisense/Code parser error
Reply #3 - Feb 18th, 2013 at 11:33am
Print Post  
I ran into this one too - discovered in my case the problem was a duplicate definition - when I put my enum in a .h file then wrapped #ifndef ...... #define .....  #endif tags around the contents of the .h file the issue went away. Hope this helps
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12191
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Intellisense/Code parser error
Reply #4 - Feb 18th, 2013 at 7:51pm
Print Post  
Madz. That's a great point. 

I had forgotten how sensitive vs is about multiple definitions. 

Thanks!
  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint