[PATCH] vhost: fix build with gcc 4.8

Maxime Coquelin maxime.coquelin at redhat.com
Thu Jul 6 11:05:54 CEST 2023



On 7/3/23 10:21, Ali Alnubani wrote:
> Adds braces around initializer to resolve the following
> false-positive build error with gcc 4.8.5 on CentOS:
> lib/vhost/vduse.c:441:9: error: missing braces around initializer
>    [-Werror=missing-braces]
> 
> Fixes: 653327e191f0 ("vhost: add multiqueue support to VDUSE")
> Cc: maxime.coquelin at redhat.com
> 
> Signed-off-by: Ali Alnubani <alialnu at nvidia.com>
> ---
>   lib/vhost/vduse.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c
> index a509daf80c..aa5f1f564d 100644
> --- a/lib/vhost/vduse.c
> +++ b/lib/vhost/vduse.c
> @@ -438,7 +438,7 @@ vduse_device_create(const char *path)
>   	pthread_t fdset_tid;
>   	uint32_t i, max_queue_pairs, total_queues;
>   	struct virtio_net *dev;
> -	struct virtio_net_config vnet_config = { 0 };
> +	struct virtio_net_config vnet_config = {{ 0 }};
>   	uint64_t ver = VHOST_VDUSE_API_VERSION;
>   	uint64_t features = VDUSE_NET_SUPPORTED_FEATURES;
>   	struct vduse_dev_config *dev_config = NULL;


Applied to dpdk-next-virtio/main.

Thanks,
Maxime



More information about the dev mailing list