Skip to main content

IAR Embedded Workbench for RL78 5.20

weak

In this section:
Syntax
#pragma weak symbol1[=symbol2]
Parameters

symbol1

A function or variable with external linkage.

symbol2

A defined function or variable.

Description

This pragma directive can be used in one of two ways:

  • To make the definition of a function or variable with external linkage a weak definition. The __weak attribute can also be used for this purpose.

  • To create a weak alias for another function or variable. You can make more than one alias for the same function or variable.

Example

To make the definition of foo a weak definition, write:

#pragma weak foo

To make NMI_Handler a weak alias for Default_Handler, write:

#pragma weak NMI_Handler=Default_Handler

If NMI_Handler is not defined elsewhere in the program, all references to NMI_Handler will refer to Default_Handler.

See also

__weak.