int main()
{
int i = 0;
int *p = &i;
int *q = &&i;
return 0;
}
When compiling this using gcc
on Linux
, I am getting the error
addr.c: In function ‘main’:
addr.c:6:2: error: label ‘i’ used but not defined
Why is the compiler treating int i
as label
and not integer? When do we use && operator
?
EDIT: Okay, I can somewhat understand the answers, but can you explain the below macro definition from "arch/arm/include/asm/processor.h". It doesn't says anything about label
, but the comment says, it can return the "program counter
"
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
*/
#define current_text_addr() ({ __label__ _l; _l: &&_l;})