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 Macro __LINE__ wrong value (Read 3323 times)
amelia
Junior Member
**
Offline


Posts: 10
Location: ITALY
Joined: Apr 23rd, 2013
Macro __LINE__ wrong value
Dec 1st, 2016 at 1:44pm
Print Post  
The __LINE__ macro reports a wrong line number, augmented respect to the real.
In Arduino IDE, it is OK.

The __FILE__ reference is  to  temp building file not to .INO.

amelia


Installed 2016.11.30 version.
« Last Edit: Dec 1st, 2016 at 2:06pm by amelia »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Macro __LINE__ wrong value
Reply #1 - Dec 1st, 2016 at 2:58pm
Print Post  
Hi,

These are Gcc variables not maintained by the ide.

Maybe the arduino ide resets the __LINE__ and __FILE__ ? 

I will investigate.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Macro __LINE__ wrong value
Reply #2 - Dec 1st, 2016 at 10:18pm
Print Post  
update

I have test this and see what you mean. I'll look into it thanks for the post.

  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Macro __LINE__ wrong value
Reply #3 - Dec 1st, 2016 at 10:37pm
Print Post  
Okay I have seen what is required. 

During the past 12 months Arduino has moved to a new build system. Visual Micro has done the same except for one outstanding job related to how function prototypes and the arduino.h header are automatically inserted into the temporary .cpp prior to build.

It turns out the same system adjusts the compilers __FILE__ and __LINE__ knowledge. It's a better way to work and removes the need to handle the switching of source locations in the compiler error output and debug handlers.

An update should be available within the next few weeks with the changes. I'll post here the version number when it is.

Arduino solution released and discussed here
« Last Edit: Dec 2nd, 2016 at 1:59am by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint