This is a query in continuity with my last query
I was trying to execute the following code in gdb :
struct t {} ;
struct s {int a, b, c, d, e, f, g, h, i, j ;} ;
register int aa __asm__("esi") ;
void f(register int a) {}
main() {
register int x=1291;
register int arr[10] ={1,2,3};
register int y = 8 ;
register int a = 8, b = 78 ;
int xx = 90 ;
register struct t tvar; //, *tp = &tvar ;
register struct s var ; //, *sp = &var;
xx = x ;
xx = a ;
xx = y ;
}
Now in gdb the results are as follows :
(gdb) p &x
$1 = (int *) 0xbffff17c
(gdb) p &y
Address requested for identifier "y" which is in register $ebx
(gdb) p &a
Address requested for identifier "a" which is in register $edi
(gdb) p &b
Can't take address of "b" which isn't an lvalue.
(gdb) p a
$2 = 8
(gdb) p b
$4 = <optimized out>
(gdb) p &tvar
$5 = (struct t *) 0xbffff1df
(gdb) p &var
$6 = (struct s *) 0xbffff1b0
Now address of tvar, var and arr show that the register request has been ignored by compiler for array and structure variables (I hope I am right)
But why is address of x displayed.
Also why does it say Can't take address of "b" which isn't an lvalue
And why does print b show $4 = optimized out
I fail to understand what is actually happening