__attribute__((used))

Prevents a function or static variable from being dead-stripped.

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

This attribute specifies that the linker must not dead-strip a function or static variable even if the linker determines that the rest of the program does not refer to the object.