[Xorp-hackers] Bug in the 64-bit floating point xrl-atom logic on windows (mingw)

Steven Simpson ss at comp.lancs.ac.uk
Wed Jun 6 14:34:25 PDT 2012


Hi Ben,

On 06/06/12 19:39, Ben Greear wrote:
> I see this warning when cross-compiling for windows (using 
> ./win32_pkg.bash):
>
> libxipc/xrl_atom.cc: In member function 'const std::string 
> XrlAtom::value() const':
> libxipc/xrl_atom.cc:635: warning: unknown conversion type character 
> 'A' in format
> libxipc/xrl_atom.cc:635: warning: too many arguments for format
>
> Maybe XORP_PRIAFP64 isn't properly defined when compiling with mingw?

Hmm, I think I went for hex float format because it looked like it would 
be more likely to scan back in with the same value, and it might be more 
compact.  However, it's a bit of C99 I forgot was in there.

It should be alright to switch to XORP_PRIGFP64, which will give a 
decimal notation.

There's an option to try to detect "%A" support at compile time, but if 
someone is using string representation to transfer an XRL, and the 
receiver doesn't have support for hex float representation, it might 
fail to parse at the other end.  So it's probably safer to stick to "%G".

Note that scanning already uses XORP_SCNgFP64 (xrl_atom.cc:227), and in 
any case, scanf accepts any format regardless of whether you specify a, 
g, etc.  So there shouldn't be any changes necessary there.

Regards,

Steven



More information about the Xorp-hackers mailing list