acassis commented on PR #12786:
URL: https://github.com/apache/nuttx/pull/12786#issuecomment-2257013829

   > > > > Avoid creating Kconfig entrypoint and just create the macro and 
include some info that it will be deprecated and the developers should use 
capture_initialize()
   > > > 
   > > > 
   > > > Agreed, but how do we make a noticeable warning (at build-time) that 
the deprecated API is used? It would be best if messages could be printed at 
end of compile output.
   > > 
   > > 
   > > There is a deprecated attribute, it is used on Linux kernel.
   > > We could create it for NuttX as well:
   > > ```
   > > #ifdef __GNUC__
   > > #define __deprecated __attribute__((deprecated))
   > > #else
   > > #define __deprecated
   > > #endif
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > So we just add:
   > > ```
   > > void old_function(void) __deprecated;
   > > 
   > > void old_function(void)
   > > {
   > >     // implementation
   > > }
   > > ```
   > 
   > @acassis thank you!
   > 
   > I looked up attribute __deprecated and found this StackOverflow answer 
which covers GCC, Clang, and MSVC:
   > 
   > https://stackoverflow.com/a/21265197
   > 
   > tl;dr GCC and Clang use **attribute**((deprecated)) (but we should check 
for **GNUC** || **clang**) while MSVC uses __declspec(deprecated).
   
   Yes, but I think we don't need to implement MSVC since we don't have support 
for it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to