In article <11**********************@g43g2000cwa.googlegroups .com>,
<Te*********@charter.net> wrote:
I was wondering if anyone has some suggestions on how to deprecate C
routines from a n already released API. I would like to be able to do
this via the gcc compiler and be warn the end developers of the new
routine to use if possible.
There are several ways of dealing with this.
Plain old text:
if (! nag_inhibit_for_version_1_0)
{
printf("* You are using an old version of this API function\n");
printf("* The new version is called Blah_Blah()\n");
printf("* Set 'nag_inhibit_for_version_1_0' to non-zero to\n");
printf(" prevent this message from appearing when using the\n");
printf(" old blabla() functionality\n");
printf("* Support for blabla() will be removed on Apr 01 2007\n");
nag_inhibit_for_version_1_0 = 1;
}
A more friendly way would be to document the change and notify
your customers/users through actual communication. Perhaps
send out letters and announcements to paying customers or post
to a developer email list if it's GPL or freeware.
When possible, I like to keep the old interface around, but
just have it make calls to the new functions. Obviously
this is not possible if the interface changes drastically.
If your API is implemented using a library or DLL you
may be able to use versioning or the file name itself to
force the end developer to pay attention to the API change.
--
7842++