Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does && mean in void *p = &&abc;

Tags:

c++

c

operators

gcc

I came across a piece of code void *p = &&abc;. What is the significance of && here? I know about rvalue references but I think && used in this context is different. What does && indicate in void *p = &&abc; ?

like image 820
Brent Arias Avatar asked May 24 '11 06:05

Brent Arias


1 Answers

&& is gcc's extension to get the address of the label defined in the current function.

void *p = &&abc is illegal in standard C99 and C++.

This compiles with g++.

like image 174
Prasoon Saurav Avatar answered Sep 25 '22 21:09

Prasoon Saurav