From Bugzilla Helper: User-Agent: Mozilla/5.0 Galeon/1.2.7 (X11; Linux i686; U;) Gecko/20021128 Description of problem: printf() format warnings for %p (and %s and %n) format printed with -pedantic shows bad variable types, one level of pointerness is missing. Version-Release number of selected component (if applicable): 3.2-7 How reproducible: Always Steps to Reproduce: 1. create a p.c file with following contents: #include <stdio.h> int main(void) { double *a, **b; printf("%p, %p\n", a, b); return 0; } 2. compile it gcc -c -Wall -pedantic p.c Actual Results: p.c: In function `main': p.c:4: warning: void format, double arg (arg 2) p.c:4: warning: void format, pointer arg (arg 3) Expected Results: Hard to say. What I definitely don't expect is the `double arg' on the second line, when arg 2 is POINTER to a double, not a double. So expected result is anything between no warnings (when I'm printing pointers with %p one is as good as another) and fully descriptive warning like (crazy, but the kind of thing one expects from -pedantic): p.c: In function `main': p.c:4: warning: void* format, double* arg (arg 2) p.c:4: warning: void* format, double** arg (arg 3) Additional info: While `double arg' corresponds to `void format' in the warning in the sense both have one level of pointerness removed, it's confusing compared to printf("%d", *a); which prints p.c:5: warning: int format, double arg (arg 2) Both *a and a can't be double simultaneously. The same happens for %s and %n conversion specifiers.
The same bad wording persists through gcc 3.4; gcc 4.0 will generate z.c:4: warning: format '%p' expects type 'void *', but argument 2 has type 'double *' z.c:4: warning: format '%p' expects type 'void *', but argument 3 has type 'double **'