You copied the Doc URL to your clipboard.

__attribute__((weak)) variable attribute

The declaration of a weak variable is permitted, and acts in a similar way to __weak.

  • in GNU mode:

    extern int Variable_Attributes_weak_1 __attribute__((weak));
    
  • the equivalent in non-GNU mode is:

    __weak int Variable_Attributes_weak_compare;
    

Note

The extern qualifier is required in GNU mode. In non-GNU mode the compiler assumes that if the variable is not extern then it is treated like any other non weak variable.

Note

This variable attribute is a GNU compiler extension that the ARM compiler supports.

See also

Was this page helpful? Yes No