nutanix / libvfio-user

framework for emulating devices in userspace
BSD 3-Clause "New" or "Revised" License
162 stars 51 forks source link

samples/client.c: fix implicit casting of const char pointers #682

Closed jraman567 closed 2 years ago

jraman567 commented 2 years ago

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