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

[xen staging] ocaml/libs: Fill build failure due to unused variable in ocaml macro



commit d84f6870fe18565c93937224fc0e1a2b69aa529a
Author:     Javi Merino <javi.merino@xxxxxxxxx>
AuthorDate: Thu Oct 17 17:20:20 2024 +0100
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Oct 18 10:56:41 2024 +0100

    ocaml/libs: Fill build failure due to unused variable in ocaml macro
    
    On Fedora 40, the build fails with:
    
        In file included from domain_getinfo_stubs_v1.c:10:
        domain_getinfo_stubs_v1.c: In function 'xsd_glue_failwith':
        /usr/lib64/ocaml/caml/memory.h:275:29: error: unused variable 
'caml__frame' [-Werror=unused-variable]
          275 |   struct caml__roots_block *caml__frame = *caml_local_roots_ptr
              |                             ^~~~~~~~~~~
        domain_getinfo_stubs_v1.c:48:9: note: in expansion of macro 'CAMLparam0'
          48 |         CAMLparam0();
             |         ^~~~~~~~~~
        cc1: all warnings being treated as errors
    
    The CAMLparam0 macro is defined in /usr/lib64/ocaml/caml/memory.h:255 as:
    
        #define CAMLparam0()                                                    
\
          struct caml__roots_block** caml_local_roots_ptr =                     
\
            (DO_CHECK_CAML_STATE ? Caml_check_caml_state() : (void)0,           
\
             &CAML_LOCAL_ROOTS);                                                
\
          struct caml__roots_block *caml__frame = *caml_local_roots_ptr
    
    We can't modify the macro.  But, it turns out there's a CAMLnoreturn macro
    with the sole purpose of masking this warning.
    
    Fixes: a6576011a4d2 ("ocaml/libs: Implement a dynamically-loaded plugin for 
Xenctrl.domain_getinfo")
    Signed-off-by: Javi Merino <javi.merino@xxxxxxxxx>
    Acked-by: Christian Lindig <christian.lindig@xxxxxxxxx>
---
 .../libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c     | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c 
b/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
index 7be386f4d4..963cec8883 100644
--- 
a/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
+++ 
b/tools/ocaml/libs/xsd_glue/domain_getinfo_plugin_v1/domain_getinfo_stubs_v1.c
@@ -69,6 +69,7 @@ static void Noreturn xsd_glue_failwith(
        free(str);
 
        caml_raise_with_arg(*caml_named_value("xsg.error_v1"), msg);
+       CAMLnoreturn;
 }
 #define xsd_glue_failwith(xch) xsd_glue_failwith(xch, __func__, __LINE__)
 
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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