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

Debarshi Ray debarshi.ray at gmail.com
Mon Dec 11 20:06:43 CET 2006


> > __deprecated void deprecated_function_proto();

> How does the compiler act when it comes across this?
> Is it compatible (if yes, to what extent) with non-GCC compilers?
> Weeding GCC extensions out of Parted is not an easy thing to do, but we
> need not make it worse...

It seems to be ANSI compatible.

#include <stdio.h>

#define __deprecated __attribute__((deprecated))

__deprecated void foo(void);

int main(void) {
        foo();
        return 0;
}

void foo(void) {
        printf("I am foo.\n");
}

The above code being compiled with -ansi -pedantic gives this:

[rishi at Sunflower devel]$ gcc -ansi -pedantic try.c
try.c: In function 'main':
try.c:8: warning: 'foo' is deprecated (declared at try.c:5)
[rishi at Sunflower devel]$

Happy hacking,
Debarshi
-- 
Universities are places of knowledge.  The freshman each bring a
little in with them, and the seniors take none away, so knowledge
accumulates.



More information about the parted-devel mailing list