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
Hot Topic (More than 8 Replies) #region in VS (Read 10689 times)
Scott A.
Newbies
*
Offline


Posts: 1
Joined: Jun 22nd, 2014
#region in VS
Jun 22nd, 2014 at 6:03pm
Print Post  
Are the #region and #endregion functions in VS 2013 supposed to work with Visual Micro?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #region in VS
Reply #1 - Jun 22nd, 2014 at 6:08pm
Print Post  
Hi Scott,

No they are not because the code would no longer compile in the Arduino Ide so users would be more difficult to support.

I'll put it on the list of possibles for the future. It would be useful but would need to be specially enabled by each user.

Thanks
« Last Edit: Jun 22nd, 2014 at 6:09pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Serenifly
Junior Member
**
Offline


Posts: 20
Joined: Jun 20th, 2013
Re: #region in VS
Reply #2 - Jul 27th, 2014 at 1:59am
Print Post  
#pragma region works fine for me in VS2010. It also doesn't conflict with the Arduino IDE. The IDE just ignores them.

But unfortunately this produces a warning:
"warning: ignoring #pragma endregion  [-Wunknown-pragmas]
:#pragma endregion"


I tried to suppress them with this:
#pragma GCC diagnostic ignored "-Wunknown-pragmas"

But that doesn't work for some reason Sad
Which is weird because I can ignore other warnings.
« Last Edit: Jul 27th, 2014 at 2:22am by Serenifly »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #region in VS
Reply #3 - Jul 27th, 2014 at 12:43pm
Print Post  
Thanks for the tip. This works for me and does not show any warning when warnings are switched off on the "tools>visual micro" menu

In the next release we plan to include the ability to add additional compiler/linker switches in the project properties so hopefully you can prevent these messages more easily.

Code
Select All
#pragma region RegionName
void setup()
{

 /* add setup code here */

}

void loop()
{

 /* add main program code here */

}
#pragma endregion 



Like you said, I tried to add a compiler switch but it was ignored. I suspect this is because Visual Micro is adding the warning switch based upon the tools menu setting (same as arduino ide does via file>prefs). 

So it seems we should provide a warnings project property allowing you to govern the -w switches for a project/configuration. I'll put it on the todo list thanks
« Last Edit: Jun 21st, 2017 at 11:23am by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Oakbox
Newbies
*
Offline


Posts: 6
Location: UK
Joined: Aug 17th, 2015
Re: #region in VS
Reply #4 - Sep 14th, 2015 at 11:30am
Print Post  
Hi was there any progress on this.  I don't want to disable ALL warnings.  I have tried to use -Wunknown-pragmas in the Micro General project settings but still get the warnings.
  
Back to top
 
IP Logged
 
Oakbox
Newbies
*
Offline


Posts: 6
Location: UK
Joined: Aug 17th, 2015
Re: #region in VS
Reply #5 - Sep 14th, 2015 at 11:33am
Print Post  
Sorry being very silly!  
Now using the correct flag and its working.

-Wno-unknown-pragmas

for anyone else visiting here..
« Last Edit: Sep 14th, 2015 at 11:34am by Oakbox »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #region in VS
Reply #6 - Sep 14th, 2015 at 11:40am
Print Post  
That's useful thanks. We will try to create a documentation item for this.
  
Back to top
WWW  
IP Logged
 
FrankP
Full Member
***
Offline


Posts: 240
Joined: Oct 19th, 2011
Re: #region in VS
Reply #7 - Jun 21st, 2017 at 12:20am
Print Post  
Oakbox wrote on Sep 14th, 2015 at 11:33am:
Sorry being very silly!  
Now using the correct flag and its working.

-Wno-unknown-pragmas

for anyone else visiting here..


I have this same problem, but don't know how to apply the flag you referenced; can you describe where this flag goes (extra ar flags, extra c flags, extra cpp flags, etc?) and the exact syntax you used?

TIA,

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


Posts: 12076
Location: United Kingdom
Joined: Apr 10th, 2010
Re: #region in VS
Reply #8 - Jun 21st, 2017 at 11:23am
Print Post  
Add compiler switches to the extra flags or extra switches project property. See Visual Micro project properties for more info,
  
Back to top
WWW  
IP Logged
 
FrankP
Full Member
***
Offline


Posts: 240
Joined: Oct 19th, 2011
Re: #region in VS
Reply #9 - Jun 21st, 2017 at 1:41pm
Print Post  
Thanks - adding it to the 'extra cpp flags' field did the trick for me.  See attached screenshot.

Frank

PS:  Well, I would have added a screenshot if I could have figured out how to do it.  I was completely baffled by the 'NOTE: If you had an Attachment in your post, you will need to reselect the Attachment again in the Browser Box for security reasons' message.  Maybe I'm just a 'bot Wink.

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