Originally Posted by
C99 draft, fprintf
z Specifies that a following d, i, o, u, x, or X conversion specifier applies to a size_t or the corresponding signed integer type argument; or that a following n conversion specifier applies to a pointer to a signed integer type corresponding to size_t argument.
t Specifies that a following d, i, o, u, x, or X conversion specifier applies to a ptrdiff_t or the corresponding unsigned integer type argument; or that a following n conversion specifier applies to a pointer to a ptrdiff_t argument.
What does "corresponding signed/unsigned type" mean? I tried to make a signed size_t and an unsigned ptrdiff_t type, but GCC wouldn't have it.
Code:
$ cat file.c
#include <stddef.h>
int main ()
{
signed size_t x;
unsigned ptrdiff_t y;
return 0;
}
$ gcc -std=c99 -pedantic file.c
file.c: In function 'main':
file.c:5: warning: ISO C forbids nested functions
file.c:5: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'x'
file.c:5: error: 'x' undeclared (first use in this function)
file.c:5: error: (Each undeclared identifier is reported only once
file.c:5: error: for each function it appears in.)
file.c:6: warning: ISO C forbids nested functions
file.c:6: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'y'
file.c:6: error: 'y' undeclared (first use in this function)
$