1
If I give a printf
thus:
int x=5, *px = &x;
printf("%d %ld\n", x, (long)px);
So far without Warning none, but if I change the printf
:
int x=5, *px = &x;
printf("%d %d\n", x, (int)px);
I get a warning:
Warning: cast from Pointer to integer of Different size.
What’s with the warning? I’ve been in some places and seen some very different operations ' zu' and several others, does anyone know an article that I can read just about this topic? I get Warning all the time.
I compiled this code of yours and received this warning: Warning: format '%d' expects argument of type ' int', but argument 2 has type 'long unsigned int but the result and esseq same, 8 and 4
– Fernando
@Fernando I switched to use
%ld
. This solves your Warning?– Victor Stafusa
Solved, could explain me the pq ?
– Fernando
@Fernando Esse
l
is the prefix forlong
, as explained in the table of that page.– Victor Stafusa
Obg for help, I’ll take a look at the table
– Fernando