On Wed, Nov 2, 2011 at 7:52 PM, Marvin Humphrey <[email protected]> wrote: > Here's the line in question: > > fprintf(stderr, "Can't malloc %" U64P " bytes.\n", (uint64_t)count); > > Thanks for pointing these warnings out, Hoss. I would like to silence them, > but it's hard to do that portably -- for instance, we can't cast to "long long > int" because it's not there on all systems.
I do believe that we should compile warning free, but I'm not sure I'm understanding the issue here. Hoss's error is on GCC, we're targetting C99, and you already have U64P defined as a macro? Wouldn't "%zu" work fine without the cast? I think it's standard C99 at this point, and not just a GCC extension. But if you've got a macro anyway, it should be fine to use. Historically, the reason to avoid it was support under Windows, where you would have to use "%Iu" (that's a capital 'i', not a lower case 'L'). http://msdn.microsoft.com/en-us/library/tcxf1dw6(v=VS.100).aspx Or am I missing another layer of complexity? --nate
