4.5.13. __attribute__((weakref("target")))

This variable attribute marks a variable declaration as an alias that does not by itself require a definition to be given for the target symbol.

Note

This variable attribute is a GNU compiler extension supported by the ARM compiler.

Syntax

__attribute__((weakref("target")))

Where target is the target symbol.

Example

In the following example, a is assigned the value of y through a weak reference:

extern int y;
static int x __attribute__((weakref("y")));

void foo (void)
{
  int a = x;
  ...
}

Restrictions

This attribute can only be used on variables that are declared as static.

Copyright © 2007-2010 ARM. All rights reserved.ARM DUI 0348C
Non-ConfidentialID101213