标签:different function address warning 压滤机
[root@CC c]# gcc MemTest.c -o MemTest1 -Wall
MemTest.c: In function ‘main’:
MemTest.c:24: warning: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘int *’
MemTest.c:39: warning: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘int *’
MemTest.c:24: warning: cast from pointer to integer of different size
MemTest.c:39: warning: cast from pointer to integer of different size
代码中增加下面对应颜色的部分
int i, *intptr=NULL;
intptr = (int *)malloc(sizeof(int)*16);
printf("intptr address: 0x%x\n", (unsigned int)(long)intptr);
解决warning: format ‘%x’ expects type ‘unsigned int’, but argument 2 has type ‘int *’
标签:different function address warning 压滤机
原文地址:http://richmond.blog.51cto.com/1345557/1572733