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]

Re: Passing an address to a #define in C


Hello Andi:
Thanks for the post.

I'm aware of the Labels as a Value feature. However, it seems it only work
with goto label instruction.
In my particular case, I need to use the label just to pass the relative
address of the label as a parameter to a @define statement. 
I tried using this and it didn't work.

Any other idea?

Thanks
Gus




Andi Hellmund wrote:
> 
> Hi Gus,
>> However, it seems like it only works in GCC if goto(label1) instruction
>> is
>> used... Is there any other way to do this?
>>
> 
> you might want to have a look at this online doc about label-as-values:
> 
> http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
> 
> If I remember correctly, this is not part of an official standard 
> (except the GNU C standard), so the portability of your code might 
> decrease.
> 
> Best regards,
> Andi
> 
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Passing-an-address-to-a--define-in-C-tp31890487p31894925.html
Sent from the gcc - Help mailing list archive at Nabble.com.


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