[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
 
- To: Ian Jackson <ian.jackson@xxxxxxxxxx>
 
- From: Julien Grall <julien@xxxxxxx>
 
- Date: Wed, 1 Apr 2020 23:00:24 +0100
 
- Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, "dfaggioli@xxxxxxxx" <dfaggioli@xxxxxxxx>, Christian Lindig <christian.lindig@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, David Scott <dave@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>
 
- Delivery-date: Wed, 01 Apr 2020 22:00:45 +0000
 
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
 
 
 
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
 
 
    
     |