Re: how to parse the special define

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



bb c <chenbenbin@xxxxxxxxx> writes:

> ÂÂÂÂÂÂ Could anyone get me the suggestions how to parse exp, int a @
> address, in GCC. Change the lex codes or change it to below? Thanks.
>
> #pragma a @ address
> int a;

What are you really trying to do?  If you want the variable a to be
located at a specific address, then the normal approach in gcc would be
to use a variable attribute.  To be clear, gcc does not support any such
variable attribute at present.  In a conventional Unix environment, I'm
not sure how that could be implemented.  In particular I don't think
there would be any way to implement it for an initialized variable.  The
usual way to put a variable at a specific memory address would be to use
an attribute to put the variable in a specific section and to use a
linker script to put that section at a specific address.

Ian



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux