aboutsummaryrefslogtreecommitdiff
path: root/samples
diff options
context:
space:
mode:
authorJag Raman <jag.raman@oracle.com>2022-05-13 12:09:28 -0400
committerGitHub <noreply@github.com>2022-05-13 17:09:28 +0100
commitaa3087d1ed5a29146e6ae9e29810e5dcba6c4bbe (patch)
treeda17df94957636129974c45aac2815d8db643654 /samples
parentda08ac0bbbde43f0a000f429f3fbbffe34ba898c (diff)
downloadlibvfio-user-aa3087d1ed5a29146e6ae9e29810e5dcba6c4bbe.zip
libvfio-user-aa3087d1ed5a29146e6ae9e29810e5dcba6c4bbe.tar.gz
libvfio-user-aa3087d1ed5a29146e6ae9e29810e5dcba6c4bbe.tar.bz2
samples/client.c: fix implicit casting of const char pointers (#682)
samples/client.c implicitly casts const char * to char * in a couple of places - as such discards the const qualifier. QEMU complains about this as it builds with -Werror=discarded-qualifiers This patch declares irq_to_str as an array of const char pointers. It also casts a "migrate_to() -> _argv" member explicitly Also adds '-Wwrite-strings' build flag to catch similar issues in the future Signed-off-by: Jagannathan Raman <jag.raman@oracle.com> Reviewed-by: John Levon <john.levon@nutanix.com>
Diffstat (limited to 'samples')
-rw-r--r--samples/client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/samples/client.c b/samples/client.c
index 492dd18..d1c699d 100644
--- a/samples/client.c
+++ b/samples/client.c
@@ -54,7 +54,7 @@
/* This is low, so we get testing of vfu_dma_read/write() chunking. */
#define CLIENT_MAX_DATA_XFER_SIZE (1024)
-static char *irq_to_str[] = {
+static char const *irq_to_str[] = {
[VFU_DEV_INTX_IRQ] = "INTx",
[VFU_DEV_MSI_IRQ] = "MSI",
[VFU_DEV_MSIX_IRQ] = "MSI-X",
@@ -947,7 +947,7 @@ migrate_to(char *old_sock_path, int *server_max_fds,
if (ret > 0) { /* child (destination server) */
char *_argv[] = {
path_to_server,
- "-v",
+ (char *)"-v",
sock_path,
NULL
};