The address of a label defined in the current function or a containing function can be obtained and used as a value wherever a constant of type void* is valid. The address is the return value when the label is the operand of the unary operator &&. The ability to use the address of label as a value is an extension to C99 and C++, implemented to facilitate porting programs developed with GNU C.
int main()
{
void * ptr1, *ptr2;
…
label1: …
…
label2: …
…
ptr1 = &&label1;
ptr2 = &&label2;
if (…) {
goto *ptr1;
} else {
goto *ptr2;
}
…
}