VS Arduino | |
Visual Micro >> Visual Studio 2017, 2019, 2022 >> How to mark functions as deprecated?
https://www.visualmicro.com/forums/YaBB.pl?num=1566322087 Message started by Red Baron on Aug 20th, 2019 at 5:28pm |
Title: How to mark functions as deprecated? Post by Red Baron on Aug 20th, 2019 at 5:28pm
Hi,
I want to mark some (member) functions as deprecated. The hope was gettting a hint from intellisense or the compiler when using such a method. But I never received a warning from Intellisense or the compiler. I'm using Visual Studio 2015. I tried this for Arduino Uno and for ESP8266 with no differences: Code (css):
The code compiles witout a warning. In Visual Studio I tried the same with a standard console c++ program. There I got the message 'A::foo': wurde als veraltet deklariert (German, meaning is, 'A::foo' is deprecated) |
Title: Re: How to mark functions as deprecated? Post by Visual Micro on Aug 20th, 2019 at 7:23pm
We use standard visual studio c++ in the ide and standard gcc for compile. So whatever they support is at your disposal.
If I recall visual studio is very good at showing comments in hints and intellisense. Put any comment you like before any item and I think it's automatic. Also I think adding \\\ before a method automatically extracts the method signature to the comment. |
Title: Re: How to mark functions as deprecated? Post by Red Baron on Sep 1st, 2019 at 8:51am
Yes, comments just above a function declaration are shown by intellisense.
But I'm still unable to get a warning message to the output window or the error list window. Even a simple #warning statement like #warning "this is a warning" has no effekt. #error works as expected. The compiler shows the message and terminates. What do I have to do, that these warnings are displayed? I've spent a lot of time for searching for hints in the web. Unsuccessfully. Are there any switches, defines or anything similar I have to set up? I'm using VS 2017, VM 19.0. I have tried several boards/compilers (ESP8266, Arduino uno, Arduino due (ARM)). The VS output window has the title "Micro Build". |
Title: Re: How to mark functions as deprecated? Post by Visual Micro on Sep 1st, 2019 at 12:27pm
What are the "vMicro>Compiler>Warnings" options set to?
|
Title: Re: How to mark functions as deprecated? Post by Red Baron on Sep 2nd, 2019 at 1:19pm
Thanks for the tip. That's it. I was quite blind.
|
VS Arduino » Powered by YaBB 2.6.12! YaBB Forum Software © 2000-2024. All Rights Reserved. |