Skip to contentSkip to conversation

libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype

PATCH In review Anthony PERARD 3 participants 4 messages Jun 1, 2021 – Jun 15, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype

Commit cf8c4d3d13b8 made some preparation to have one day variable-length-array argument, but didn't declare the array in the function prototype the same way as in the function definition. And now GCC 11 complains about it.

Fixes cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
---
 tools/libs/foreignmemory/private.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libs/foreignmemory/private.h +1 -1
index 1ee3626dd278..5bb0cefb0987 100644
@@ -32,7 +32,7 @@ int osdep_xenforeignmemory_close(xenforeignmemory_handle *fmem);
 void *osdep_xenforeignmemory_map(xenforeignmemory_handle *fmem,
                                  uint32_t dom, void *addr,
                                  int prot, int flags, size_t num,
-                                 const xen_pfn_t arr[num], int err[num]);
+                                 const xen_pfn_t arr[/*num*/], int err[/*num*/]);
 int osdep_xenforeignmemory_unmap(xenforeignmemory_handle *fmem,
                                  void *addr, size_t num);
 
Signature · 1 line
Anthony PERARD
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Anthony PERARD

Commit cf8c4d3d13b8 made some preparation to have one day variable-length-array argument, but didn't declare the array in the function prototype the same way as in the function definition. And now GCC 11 complains about it.

Fixes cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")

Ian - this (or whichever alternative might be chosen to address gcc11's valid complaint) also will want backporting.

Jan

#2 lore raw

PING Re: [XEN PATCH] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype

Hi Ian & Wei,

Quoted 6 lines · Jan Beulich
Quoted 5 lines · Anthony PERARD

Commit cf8c4d3d13b8 made some preparation to have one day variable-length-array argument, but didn't declare the array in the function prototype the same way as in the function definition. And now GCC 11 complains about it.

Quoted 7 lines
Quoted 2 lines
Fixes cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")

Ian - this (or whichever alternative might be chosen to address gcc11's valid complaint) also will want backporting.

I was about to commit this patch and noticed that there is still a missing an ack from the tools maintainers. @Ian, @Wei, can you provide one?

Cheers,

Signature · 1 line
Julien Grall
#3 lore raw

Re: PING Re: [XEN PATCH] libs/foreignmemory: Fix osdep_xenforeignmemory_map prototype

Hi,

Quoted 12 lines · Julien Grall

Hi Ian & Wei,

Quoted 9 lines · Jan Beulich
Quoted 7 lines · Anthony PERARD

Commit cf8c4d3d13b8 made some preparation to have one day variable-length-array argument, but didn't declare the array in the function prototype the same way as in the function definition. And now GCC 11 complains about it.

Fixes cf8c4d3d13b8 ("tools/libs/foreignmemory: pull array length argument to map forward")
Quoted 6 lines
Quoted 4 lines

Ian - this (or whichever alternative might be chosen to address gcc11's valid complaint) also will want backporting.

I was about to commit this patch and noticed that there is still a missing an ack from the tools maintainers. @Ian, @Wei, can you provide one?

From an IRC discussion, Ian was happy to follow the rule:

"Commit something without the necessary acks if you're reasonably certain that the maintainer would have approved it"

This doesn't seem to be part of MAINTAINERS, but I will use it for this patch as Ian gave his assent.

This is committed now.

Cheers,

Signature · 1 line
Julien Grall