The weak function attribute

IBM Extension Beginning of IBM® Extension.

The weak function attribute causes the symbol resulting from the function declaration to appear in the object file as a weak symbol, rather than a global one. The language feature provides the programmer writing library functions with a way to allow function definitions in user code to override the library function declaration without causing duplicate name errors.

C++ Beginning of C++ only.

weak function attribute syntax

Read syntax diagramSkip visual syntax diagram__attribute__(( weak__weak__ ))

C++ End of C++ only.

Related information

IBM Extension End of IBM Extension.