level 6
$ cat test_p.c
#include <stdio.h>
void point (char *ss) {
char *px = ss;
printf("%#x\n", px);
++px;
printf("%#x\n", px);
}
int main (void) {
char s[99];
point(&s);
return 0;
}
$ clang test_p.c
test_p.c:5:21: warning: format specifies type 'unsigned int' but the argument has type
'char *' [-Wformat]
printf("%#x\n", px);
~~~ ^~
%s
test_p.c:7:21: warning: format specifies type 'unsigned int' but the argument has type
'char *' [-Wformat]
printf("%#x\n", px);
~~~ ^~
%s
test_p.c:12:11: warning: incompatible pointer types passing 'char (*)[99]' to parameter of
type 'char *' [-Wincompatible-pointer-types]
point(&s);
^~
test_p.c:3:19: note: passing argument to parameter 'ss' here
void point (char *ss) {
^
3 warnings generated.
$ ./a.out
0xca7d9a48
0xca7d9a49
$
2017年12月17日 05点12分
