This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

__attribute__((alias())) for variables?


Hi,

The alias attribute in __attribute__((alias())) is defined as a function attribute (http://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html).

It is not defined as a variable attribute (http://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html).

However, I tried using it for variables (under cygwin on pentium, gcc version 3.4.4) and it seems to work!
For example,


   int AAA;
   extern int BBB  __attribute__((alias("AAA")));

seems to work properly. And it also creates the proper stabs for debugging info.

Then my question is: why does the online help (links above) define the alias attribute for functions only?
- Is there a catch and it doesn't really work?
- Is the help not up to date?
- Or is the grammar general enough such that what works for functions often automatically works for variables, but you didn't report it?


I need this information in order to check with Texas Instruments whether they can properly implement the feature on their DSP compilers. It seems to be only partially implemented there.

Thank you,

Rabih Chrabieh


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]