[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 0/8] Fix build with using OCaml 4.06.1 and -safe-string



Hi Ian,

On 31/03/2020 12:17, Ian Jackson wrote:
Julien Grall writes ("[PATCH 0/8] Fix build with using OCaml 4.06.1 and 
-safe-string"):
This series is meant to solve the build issue reported by Dario when
using recent version of OCaml and -safe-string.

Thanks.  I have reviewed the C tools parts here.  I think the ocaml
parts ought to have a review from someone familiar with the ocaml FFI.

I took the opportunity to harden a bit more the code by using const more
often.

I approve.

Perhaps we should start building our C code with -Wwrite-strings,
which makes "" have type const char* ?  Result would be a giant
constification patch, probably.

So I thought I would give a try and see how far I can go:

* hypervisor (xen): It is fairly easy to convert, although this is touching code that was imported from other projects (such as acpica). I need to have a look at whether other projects fixed there code and we can backport.
   * libxc: This is pretty trivial, I will send a patch for it
* libxl: This is where it is getting tricky, the main issue is the flexarray framework as we would use it with string (now const char *). I thought we could make the interface const, but it looks like there are a couple of places where we need to modify the content (such as in libxl_json.c). I am not sure yet how to deal with it.

In any case, even if we can't use -Wwrite-strings, I can still send patches to use const in more places.

Cheers,

--
Julien Grall



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.