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 Bug: False-positive syntax error highlights with avr-gcc Asm code (Read 2542 times)
AliShug
Newbies
*
Offline


Posts: 1
Joined: Sep 7th, 2016
Bug: False-positive syntax error highlights with avr-gcc Asm code
Sep 7th, 2016 at 1:22pm
Print Post  
Inline avr-gcc assembly code is incorrectly flagged with syntax errors when using GCC's Extended Asm definition (https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html).

Example:
Code (C++)
Select All
asm volatile ("mov %0, %[bar] \n" : "=r" (foo) : [bar] "r" (bar)); 



When extended over multiple lines it can also trigger false errors on lines immediately afterwards.

Obviously, this all still compiles and runs fine, but the error flagging is one of the main reasons I'm using Visual Micro  Undecided I appreciate there aren't many people using inline Asm, though.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Bug: False-positive syntax error highlights with avr-gcc Asm code
Reply #1 - Sep 7th, 2016 at 3:37pm
Print Post  
Hi,

I am going to assume you are using Visual Studio and not Atmel Studio.

In Visual Studio we currently use the VC++ intellisense which isn't perfect.

Microsoft has released some better tools in the past year or so, such as Clang and we might shortly move to using what should be a better system for intellisense. I am not sure how it will cope with assembly code but in theory much better.

Breaking code over multiple lines is probably an unsolvable problem for VC++ however for some other errors can be prevented as follows:-

Add a .h to the project but do not need to #include from any code. Then use the standard _MSC_VER variable to make alternative definitions that intellisense will be happy with.

Obviously if there are many different intellisense errors this isn't a practical solution but so far it's been ok for most.

Example:-

Code
Select All
#pragma once

#if _MSC_VER

//insert dummy defs here
//ie: digitalWrite(int, int){}

#endif 



If this issue becomes too difficult to manage you can consider using the Atmel Studio version of Visual Micro. Atmel Studio understands Gcc but isn't quite as full an IDE as Visual Studio.

Interested to hear your thoughts
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint