Subject: | Tests fail with compiler warning on ptr_test_cast.c |
On some platforms (eg. MacOS X 10.6) sizeof() returns long unsigned int
and gcc can give the following complaint (probably depedning on gcc
version - in this case i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple
Inc. build 5646) (dot 1)):
# Failed test 'STDERR empty after compiling'
# at t/local/00_ptr_cast.t line 28.
# got: 't/local/ptr_cast_test.c: In function 'main':
# t/local/ptr_cast_test.c:27: warning: format '%d' expects type 'int', but
argument 4 has type 'long unsigned int'
# t/local/ptr_cast_test.c:27: warning: format '%d' expects type 'int', but
argument 6 has type 'long unsigned int'
# '
# expected: ''
Subject: | ptr_cast_test.diff |
--- t/local/ptr_cast_test.c~ 2007-10-16 18:26:45.000000000 +1000
+++ t/local/ptr_cast_test.c 2009-12-07 21:35:36.000000000 +1100
@@ -24,7 +24,7 @@
volatile TOTYPE i; /* prevent optimization */
printf("# %s: '%s' len: %d, '%s' len: %d.\n", argv[0], FROMTYPESTR,
- sizeof(TOTYPE), TOTYPESTR, sizeof(char *));
+ (int)sizeof(TOTYPE), TOTYPESTR, (int)sizeof(char *));
i = (TOTYPE)bufptr;
if( ((FROMTYPE)i) != bufptr ) {