For Programmers: Free Programming Magazines  


Home > Archive > VC STL > January 2006 > @deprecated in C++: anything better than #pragma message( "Warning









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author @deprecated in C++: anything better than #pragma message( "Warning
ultranet

2006-01-09, 11:10 pm

I'm going to use
#pragma message( "Warning: <my function/> is deprecated." )
for now.

If you have any better ideas, please speak out.

P.S. E.g., could #pragma warning be used in a way that forces the coder to
change warning level before they are able to build code that links to the
function? How could i look up which warnings are on which level? Is it
possible to force a warning instead of message?
ultranet

2006-01-09, 11:10 pm

I'm actually having doubts that #pragma message will work:
if i put it in function declaration (.h), every time hearder is included the
warning is given: too much.
If i put it in definition (.cpp), message doesn't appear to be dumped when
other modules are built that link to the function.
Igor Tandetnik

2006-01-09, 11:10 pm

ultranet <ultranet@discussions.microsoft.com> wrote:
> I'm going to use
> #pragma message( "Warning: <my function/> is deprecated." )
> for now.
>
> If you have any better ideas, please speak out.


See #pragma deprecated, __declspec(deprecated).
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com