1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-10 06:47:55 -08:00

Make that test pass on 64 bit platforms as well.

This commit is contained in:
miod 2008-09-11 10:06:29 +00:00
parent 42bdce3541
commit 90140cc775
3 changed files with 13 additions and 7 deletions

View File

@ -1,8 +1,14 @@
#include <stdio.h>
#if defined(__LP64__)
#define DUMMYSIZE 104
#else
#define DUMMYSIZE 100
#endif
int main(int argc, char **argv) {
char *buf;
char buf2[10];
snprintf(buf2, -sizeof(buf) + 100, "%s", "foo");
snprintf(buf2, -sizeof(buf) + DUMMYSIZE, "%s", "foo");
return 1;
}

View File

@ -1,3 +1,3 @@
snprintf-4.cpp: In function `int main(int, char **)':
snprintf-4.cpp:6: warning: sizeof(pointer) possibly incorrect in argument 2
snprintf-4.cpp:6: warning: array size (10) smaller than bound length (96)
snprintf-4.cpp:12: warning: sizeof(pointer) possibly incorrect in argument 2
snprintf-4.cpp:12: warning: array size (10) smaller than bound length (96)

View File

@ -1,5 +1,5 @@
snprintf-4.cpp: In function `int main(int, char**)':
snprintf-4.cpp:6: warning: sizeof(pointer) possibly incorrect in argument 2
snprintf-4.cpp:6: warning: array size (10) smaller than bound length (96)
snprintf-4.cpp:6: warning: sizeof(pointer) possibly incorrect in argument 2
snprintf-4.cpp:6: warning: array size (10) smaller than bound length (96)
snprintf-4.cpp:12: warning: sizeof(pointer) possibly incorrect in argument 2
snprintf-4.cpp:12: warning: array size (10) smaller than bound length (96)
snprintf-4.cpp:12: warning: sizeof(pointer) possibly incorrect in argument 2
snprintf-4.cpp:12: warning: array size (10) smaller than bound length (96)