On Fri, August 25, 2006 2:34 pm, Alexandre Julliard wrote:
Author: Alexandre Julliard julliard@winehq.org Date: Fri Aug 25 18:37:38 2006 +0200
crypt32/tests: Avoid sizeof in traces.
This is non-obvious -- why is that?
"Dimi Paun" dimi@lattica.com writes:
crypt32/tests: Avoid sizeof in traces.
This is non-obvious -- why is that?
It's causing warnings on some platforms, like MacOS. Actually there was a big cleanup some time ago, this one just crept back in since then.
On Fri, August 25, 2006 2:55 pm, Alexandre Julliard wrote:
It's causing warnings on some platforms, like MacOS.
Just so I know, what is the warning? Does sizeof() return a 64-bit integer on those platforms?
"Dimi Paun" dimi@lattica.com writes:
Just so I know, what is the warning? Does sizeof() return a 64-bit integer on those platforms?
Not on 32-bit platforms, but it's defined as long instead of int so we still get a printf format warning.
On 8/25/06, Alexandre Julliard julliard@winehq.org wrote:
Just so I know, what is the warning? Does sizeof() return a 64-bit integer on those platforms?
Not on 32-bit platforms, but it's defined as long instead of int so we still get a printf format warning.
The incredibly ugly solution I've used in the past is
// printf macros for size_t, in the style of inttypes.h #ifdef _LP64 #define __PRIS_PREFIX "z" #else #define __PRIS_PREFIX #endif #define PRIuS __PRIS_PREFIX "u"
and then printf("size is %" PRIuS "\n", sizeof(foo));
Much nicer just to avoid using size_t in printf's if you can. - Dan
On Fri, Aug 25, 2006 at 02:18:49PM -0700, Dan Kegel wrote:
On 8/25/06, Alexandre Julliard julliard@winehq.org wrote:
Just so I know, what is the warning? Does sizeof() return a 64-bit integer on those platforms?
Not on 32-bit platforms, but it's defined as long instead of int so we still get a printf format warning.
The incredibly ugly solution I've used in the past is
// printf macros for size_t, in the style of inttypes.h #ifdef _LP64 #define __PRIS_PREFIX "z" #else #define __PRIS_PREFIX #endif #define PRIuS __PRIS_PREFIX "u"
and then printf("size is %" PRIuS "\n", sizeof(foo));
Much nicer just to avoid using size_t in printf's if you can.
That doesn't help for the case: char xxx[...] ... printf("%.*s", sizeof xxx, xxx); since the argument for '*' has to be of type 'int'. Here you have to have the (int) cast, directly of maybe via: #define isizeof (void)sizeof
David