avoid deprecated methods

Benjamin Meyer kde-optimize@mail.kde.org
Tue, 11 Feb 2003 14:05:26 -0500


On Tuesday 11 February 2003 2:02 pm, Zack Rusin wrote:
> On Tuesday 11 February 2003 13:46, Benjamin Meyer wrote:
> > No matter what we do do it would be a good idea to have a common way
> > of specifing things that are deprecated so when we do break binary
> > compatibility (down the line) we will have a nice big list of old
> > deprecated functions to prune.  Is "@deprecated" in the header the
> > correct way of doing this?
>
> For now that's the only way.

Fine by me.  I have gone through kdeui and added @deprecated to a number of 
functions that didn't have "@deprecated" in their headers, but did specify 
that the function was now deprecated.

-Benjamin Meyer

> We may add something like:
>
> #if __GNUC__ >= 3 && __GNUC_MINOR__ >= 2
> #  define KDE_DEPRECATED __attribute__((deprecated))
> #else
> # define KDE_DEPRECATED
> #endif
>
> and then uses of methods like:
> void someMethod() KDE_DEPRECATED;
> would be caught at compile time. It won't work all that well for slots
> though because the metacompiler will use them anyway but for normal
> methods it would work rather nicely.
>
> Zack