Subject: Re: Cygwin and git 1.5.1

From: Ramsay Jones <[email-masked]>
Date: Sat, 14 Apr 2007 18:21:40 +0100

H. Peter Anvin wrote:
> Ramsay Jones wrote:
>> Hi Junio,
>>
>> I recently upgraded to 1.5.1, via tarball as usual, without much problem.
>> The only problem being the "printf format warnings" issue, which prevents
>> me building with -Werror.
>>
>> I have included, below, an updated version of my patch from the 1.5.0 
>> series.
>> We agreed last time that this patch is not the correct solution to this
>> problem in general (but it works on cygwin!), so this is *not* intended
>> for submission. I just wanted to document the problem. As before, I don't
>> really have a solution; I suppose I will just have to carry this patch
>> forward with each release - no big deal.
>>
>> Note that the patch has grown larger. This is due to the increased use of
>> uint32_t (in combination with printf/die/error etc).
>> I guess not many others use -Werror to build on cygwin! ;-)
> 
> The excruciatingly correct way to do this is to use the macros defined 
> in <inttypes.h>, so for uint32_t one should use %"PRNu32" instead of %u, 
> for example.
> 
>     -hpa
> 

Yes, that would work. However, I rejected this solution last time, because
I did not want to add a dependency on the C99 header files.
Having said that, that ship has probably sailed ... ;-)

Maybe I will rework the patch to see how it looks. (I suspect that, while
it will be better than sprinkling casts about the place, it will probably
look quite ugly ;-P)

All the best,

Ramsay Jones