[parted-devel] Deprecate ped[register|unregister]_disk_type

Otavio Salvador otavio at debian.org
Sun Dec 10 17:58:15 CET 2006


leslie.polzer at gmx.net writes:

> On Sat, Dec 09, 2006 at 05:09:24PM -0200, Otavio Salvador wrote:
>
>> I think it's right but I would suggest that we make a macro to make
>> easier to warn user. I don't think that an exception is right but we
>> can display a warning while compiling.
>>
>> Other's comments?
> I think the common way to do this is to wrap an
>
> #ifdef DEPRECATED_20
>    deprecated_function_proto();
> #endif
>
>   around the function in question in the header file.
>
> Distribution vendors then only have to add a -DDEPRECATED_20 to the
> build of the package to fix it for the time being, and the author
> of the package is woken up and incited to fix his stuff :)

I personally like how the kernel folks does it. They use a definition
to add an attribute that raise a warning on compile time. For example:

#define __deprecated                       __attribute__((deprecated))

So you just need:

__deprecated void deprecated_function_proto();

What others think about this way of doing it?

-- 
        O T A V I O    S A L V A D O R
---------------------------------------------
 E-mail: otavio at debian.org      UIN: 5906116
 GNU/Linux User: 239058     GPG ID: 49A5F855
 Home Page: http://otavio.ossystems.com.br
---------------------------------------------
"Microsoft sells you Windows ... Linux gives
 you the whole house."



More information about the parted-devel mailing list