Capstar wrote:
Hi NG,
I have a library of which I want to change the name of a specific method
so it is more intuitive. I plan to keep the old method in there for now
so I won't break any existing code. But I would like to get a compile
time warning when this method is called. That way a programmer using
this library sees the warning and can change his/her code.
Is this possible and if yes, how?
There is no standard way.
However, most compiler offer a pragma that can do
that.
Eg. in VC++ a line
#pragma message( "Attention" )
will output the text "Attention" during compilation.
You could now
rename the function in the library
using a macro, replace any call to the function with
the sequence
#pragma message( "Warning: old function call, use XXX instead" )
call renamed function
-
Karl Heinz Buchegger
kb******@gascad.at