Re: the address of local labels

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

 



On Tue, 10 Apr 2007, Robert P. J. Day wrote:

>   not strictly speaking a kernel question, but i noticed that most
> architectures define a macro to generate the current text address
> using a local label:
>
>   #define current_text_addr() ({ __label__ _l; _l: &&_l;})
>
> now, maybe i'm confused by the syntax, but that looks like what's
> being returned by the statement expression is the "address of the
> address of _l".  is that right?  why would you need to use *two*
> address-of operators, rather than just one?  just curious how this
> actually works.  thanks.

never mind.  i just read that "&&" is, in fact, the unary "take
address of label" operator.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://fsdev.net/wiki/index.php?title=Main_Page
========================================================================

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux