On Monday, 18 July 2016 09:49:37 CEST Richard W.M. Jones wrote:
On Mon, Jul 18, 2016 at 10:47:12AM +0200, Pino Toscano wrote:
I still don't understand why we need to handle values bigger than int (as in C int, i.e. signed 32 bits) at all -- neither it is actually needed, nor it would be coherent in 32bit vs 64bit builds.
If that's what you decide then that is fine too. My test patch checked that 63 bit integers could be returned (on 64 bit arch) but we can drop that test.
Now that I think more about it, allowing more than 31bit integers as 'int' would cause problems later on; let's take for example the handling of memsize in few OCaml tools: [ "-m"; "--memsize" ], Getopt.Int ("mb", set_memsize), ... later on, in the C implementation of Guestfs.set_memsize there is int memsize = Int_val (memsizev); this would truncated when extracted, so not much useful at this point already; even when changing the above, what follows is: r = guestfs_set_memsize (g, memsize); considering the C API takes a 32bit signed integer, it would be truncated anyway. In the end, allowing big integers for Getopt.Int/Set_int is not really doable/worth it. -- Pino Toscano