The #pragma weak directive adds an alternate function name with weak binding for the
function function_name.
>>--#--pragma--weak--(--function_name--,--backup_function_name--)--><
If the definition for the function function_name is not found, the linker resolves the function call to the definition for the function backup_function_name. Otherwise, the linker resolves the function call to the definition for function_name.
If function_name is not referenced, neither function_name nor backup_function_name needs to be declared.
If function_name is referenced, both function_name and backup_function_name must be declared.
Note: Both functions must have full prototypes within the compilation unit. Neither function can be a C++ member function. backup_function_name can not be defined in the same compilation unit as the pragma.
![]()
#pragma Preprocessor Directives
List of Preprocessor Directives