[Libguestfs] [PATCH 1/3] mllib: Fix parsing of integers on the command line and use correct int type.

Pino Toscano ptoscano at redhat.com
Mon Jul 18 08:13:10 UTC 2016


On Friday, 15 July 2016 22:37:27 CEST Richard W.M. Jones wrote:
> Currently input such as "1ABC" or "1.1" is parsed (as 1).  If there is
> trailing data on the command line, refuse to accept it.
> 
> In addition this parses the integer into a C 'long', which is as close
> as we can get to the OCaml idea of a native int.  This prevents the
> gross rounding error from the earlier code if the integer parameter
> was larger than 32 bits (on a 64 bit platform), but is still not
> completely free of rounding problems because the OCaml type is 31 or
> 63 bits.
> 
> Probably we should have explicit 'int32' and 'int64' types in the
> OCaml code, instead of using (native) 'int'.
> ---

Ops, apologies, this should have been correct when sending the initial
Getopt patch -- sending the fix I have locally here for few days.

Thanks,
-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160718/bcea10c3/attachment.sig>


More information about the Libguestfs mailing list