__attribute__((deprecated))

Specifies that the compiler must issue a warning when a program refers to an object.

Syntax
  variable-declaration __attribute__((deprecated));
  
  
  variable-definition __attribute__((deprecated));
  
  
  function-declaration __attribute__((deprecated));
  
  
  function-definition __attribute__((deprecated));
  
  
Remarks

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.

Listing: Example of deprecated attribute

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 */

}