Specifies that the compiler must issue a warning when a program refers to an object.
variable-declaration __attribute__((deprecated));
variable-definition __attribute__((deprecated));
function-declaration __attribute__((deprecated));
function-definition __attribute__((deprecated));
This attribute instructs the compiler to issue a warning when a program refers to a function or variable. Use this attribute to discourage programmers from using functions and variables that are obsolete or will soon be obsolete.
int velocipede(int speed) __attribute__((deprecated));
int bicycle(int speed);
int f(int speed)
{
return velocipede(speed); /* Warning. */
}
int g(int speed)
{
return bicycle(speed * 2); /* OK */
}