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 Teensy3 - Prevent "abs" from showing errors in Visual Studio 2017 (Read 3090 times)
gremlin
Newbies
*
Offline


Posts: 7
Joined: Dec 9th, 2017
Teensy3 - Prevent "abs" from showing errors in Visual Studio 2017
Dec 9th, 2017 at 2:17am
Print Post  
Hello all,
See screenshot.
I have a project using a Teensy 3.x.
Anytime that I use the function abs (its actually a #define that is defined in wiring.h, one of the Teensyduino core files).
Visual studio flags it as an error. Hovering states "expected an expression".
The code compiles fine and everything works. It's annoying having errors and red blocks in the scrollbar at every place I've used "abs".
Does anyone know how to fix this?  Thanks.
« Last Edit: Dec 10th, 2017 at 12:58pm by Tim@Visual Micro »  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
CliffA
Newbies
*
Offline


Posts: 4
Location: UK
Joined: Dec 10th, 2017
Re: Prevent "abs" from showing errors in Visual Studio 2017
Reply #1 - Dec 10th, 2017 at 9:05am
Print Post  
I get the same but with constrain()

Builds and works as you say but with the red squiggly underneath.

VS2017 Version 15.5.0 latest version of vMicro as I updated to be sure.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Prevent "abs" from showing errors in Visual Studio 2017
Reply #2 - Dec 10th, 2017 at 12:58pm
Print Post  
The visual studio c++ intellisense does not understand some Gcc commands. Intellisense is handled by VS and build by Visual Micro which is why the build works.

It's possible to fool VS into being happy which I will do for abs for Teensy3 in the next release.

You can always report these things along with which hardware you are using because the way some of the methods are defined change per board/platform.

You can also provide the workaround yourself without affect your code.

http://www.visualmicro.com/page/Extending-Visual-Studio-Intellisense.aspx
  
Back to top
WWW  
IP Logged
 
gremlin
Newbies
*
Offline


Posts: 7
Joined: Dec 9th, 2017
Re: Teensy3 - Prevent "abs" from showing errors in Visual Studio 2017
Reply #3 - Dec 16th, 2017 at 10:35pm
Print Post  
Thanks! I will try the work around.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Teensy3 - Prevent "abs" from showing errors in Visual Studio 2017
Reply #4 - Dec 22nd, 2017 at 10:59pm
Print Post  
Fixed in the next release due shortly.

An intellisense fix has been added for all functions found in the teensy3 wiring.h.

Intellisense will show the following but the compiler will use the real teensy code.

Code (C++)
Select All
#define abs(x)
#define constrain(amt, low, high)
#define round(x)
#define radians(deg)
#define degrees(rad)
#define sq(x) 

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