Mail Archives: djgpp-workers/1998/06/17/08:15:37
> printf("p = 0x%08p\n", p);
> testit.c:14: warning: flag `0' used with type `p'
Common practice or not, it's wrong. You aren't allowed to specify
leading zeros for pointers. Consider the Borland %p format case:
0x1234
What would the leading zero do? 000x1234?
Note: in your case, the final result would probably be 0x0x00001234
When using %p, you should either use %p as-is, or at most use %8p, but
not 0x%p or 0x%08p or %08p, because you are assuming something about
the printf formatting that you shouldn't.
- Raw text -