Winboard 4.4.1 : a bug in NPS mode ?

Discussions about the WinBoard protocol. Here you can also report bugs and request new features.

Moderators: hgm, Andres Valverde

Re: Winboard 4.4.1 : a bug in NPS mode ?

Postby Francois » 02 Feb 2010, 17:51

That is strange, i use %IU64 (that's a i of course, not a l) in my code, and got no warning with MSVisual 2005/2008.
User avatar
Francois
 
Posts: 22
Joined: 22 Apr 2006, 08:51

Re: Winboard 4.4.1 : a bug in NPS mode ?

Postby Francois » 02 Feb 2010, 17:52

I mean %I64u.
User avatar
Francois
 
Posts: 22
Joined: 22 Apr 2006, 08:51

Re: Winboard 4.4.1 : a bug in NPS mode ?

Postby H.G.Muller » 02 Feb 2010, 18:34

Well, I think this %I64u is a MicroSoft deviation of the C standard, so that MSVC likes it should be no surprise.

Having a mismatch between a format and a variable is not a fatal error, and the format string does not even have to be known at compile time, but apparently gcc does make an attempt to examine it when it is. It seem to recognize it as a plain %u format; perhaps it thinks the I64 is some instruction for how many digits to print, or perhaps it just ignores the I because it does not understand it at all. So it complains that the format is unsigned int, while the variable is long long unsigned int.

And it is wrong in that, of course. But it does not know that the object file is going to be linked with a scanf that deviates from the standard, and which does consider %I64d a format for a 64-bit variable.

I now put a 4.4.2b installer package and binary for download here on WB forum, where I cheated to correct this error. (I.e., I changed the source to use the same format in MSVC and gcc, so strictly speaking this is not 4.4.2 anymore, although the source would be 4.4.2 when compiled with MSVC. The makefile included with 4.4.2 also does not work anymore under the Cygwin upgrade that I made; it seems to contain a stray period that so far was always ignored, but where the Cygwin make now chokes on...
User avatar
H.G.Muller
 
Posts: 3453
Joined: 16 Nov 2005, 12:02
Location: Diemen, NL

Previous

Return to WinBoard development and bugfixing

Who is online

Users browsing this forum: No registered users and 10 guests