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 asm volatile considered an error but will build anyway (Read 2161 times)
BasP
Newbies
*
Offline


Posts: 4
Joined: Aug 17th, 2023
asm volatile considered an error but will build anyway
Aug 18th, 2023 at 8:58am
Print Post  
Hi, I'm encountering an odd issue.

I'm using some inline assembly in a project and for completeness and portability's sake I'm marking it as volatile, to prevent the compiler from optimizing it out:

Code (C++)
Select All
void restart()
{
    asm volatile ("jmp 0x7800");
}
 



Intellisense considers this an error, marking the semicolon and the following closing bracket with a red underline, and it shows up as such in the Error List: 

Code
Select All
Error (active)	E0125	expected a '('	foo	C:\Users\foo\Configuration.cpp	55
Error (active)	E0194	expected an asm string	foo	C:\Users\foo\Configuration.cpp	56 

     

However, if I click the build button, it builds without errors. When I remove the volatile keyword, Intellisense does not complain and it also works on build.

Any ideas? I've attached the build outputs for builds both with the volatile keyword and without it.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: asm volatile considered an error but will build anyway
Reply #1 - Aug 18th, 2023 at 9:17am
Print Post  
Can you confirm if your project has "(Arduino)" after it in Solution Explorer?

I suspect your project is using the old Intellisense system which is not as accurate as the latest one, there are instructions to migrate your project on the below page:
https://www.visualmicro.com/page/Upgraded-Intellisense-System-in-Visual-Micro.as...

You will need to ensure you have the latest version of Visual Micro installed to ensure all functionality is available, which can be found on our Downloads Page:
https://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx
  
Back to top
IP Logged
 
BasP
Newbies
*
Offline


Posts: 4
Joined: Aug 17th, 2023
Re: asm volatile considered an error but will build anyway
Reply #2 - Aug 19th, 2023 at 11:24am
Print Post  
The project was indeed the old style project! I managed to upgrade it and now it works even with the volatile keyword. Many thanks!
  
Back to top
 
IP Logged
 
kimberlyvogels
Newbies
*
Offline


Posts: 1
Joined: Apr 22nd, 2024
Re: asm volatile considered an error but will build anyway
Reply #3 - Apr 23rd, 2024 at 6:47am
Print Post  
Simon@Visual Micro wrote on Aug 18th, 2023 at 9:17am:
Can you confirm if your project has "(Arduino)" after it in Solution Explorer?

I suspect your project is using the old Intellisense system which is not as accurate as the latest one, there are instructions to migrate your project on the below page:
https://www.visualmicro.com/page/Upgraded-Intellisense-System-in-Visual-Micro.as... minecraftle game

You will need to ensure you have the latest version of Visual Micro installed to ensure all functionality is available, which can be found on our Downloads Page:
https://www.visualmicro.com/page/Arduino-Visual-Studio-Downloads.aspx

Thanks for your answer. This is what I am looking for
« Last Edit: Apr 24th, 2024 at 3:42am by kimberlyvogels »  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint