mbox series

[kvmtool,0/2] Fix builds with clang

Message ID 20230525144827.679651-1-andre.przywara@arm.com (mailing list archive)
Headers show
Series Fix builds with clang | expand

Message

Andre Przywara May 25, 2023, 2:48 p.m. UTC
When trying to build kvmtool with clang, it warned about two problems,
which are fatal since we use "-Werror".

Patch 1/2 is an easy one fixing an obvious bug (not sure why GCC didn't
warn). Patch 2/2 removes an ugly hack which clang didn't want to let
pass. This patch admittedly implements the most tedious solution to this
problem, but I didn't want to just throw in a "__maybe_unused" (or
"__used", as kvmtool puts it). If that solution is a bit over the top,
let me know, maybe there is better solution which doesn't require to
touch every user of the virtio endianess conversion functions - or
__maybe_unused is OK after all.

Cheers,
Andre

Andre Przywara (2):
  option parsing: fix type of empty .argh parameter
  virtio: sanitise virtio endian wrappers

 arm/include/arm-common/kvm-config-arch.h |  2 +-
 builtin-run.c                            |  2 +-
 include/kvm/parse-options.h              |  7 ++--
 include/kvm/virtio.h                     | 53 ++++++++++++++----------
 virtio/9p.c                              |  2 +-
 virtio/blk.c                             |  8 ++--
 virtio/console.c                         |  6 +--
 virtio/core.c                            | 37 +++++++++--------
 virtio/net.c                             |  6 +--
 virtio/scsi.c                            | 20 ++++-----
 10 files changed, 77 insertions(+), 66 deletions(-)

Comments

Will Deacon June 5, 2023, 12:35 p.m. UTC | #1
On Thu, 25 May 2023 15:48:25 +0100, Andre Przywara wrote:
> When trying to build kvmtool with clang, it warned about two problems,
> which are fatal since we use "-Werror".
> 
> Patch 1/2 is an easy one fixing an obvious bug (not sure why GCC didn't
> warn). Patch 2/2 removes an ugly hack which clang didn't want to let
> pass. This patch admittedly implements the most tedious solution to this
> problem, but I didn't want to just throw in a "__maybe_unused" (or
> "__used", as kvmtool puts it). If that solution is a bit over the top,
> let me know, maybe there is better solution which doesn't require to
> touch every user of the virtio endianess conversion functions - or
> __maybe_unused is OK after all.
> 
> [...]

Applied to kvmtool (master), thanks!

[1/2] option parsing: fix type of empty .argh parameter
      https://git.kernel.org/will/kvmtool/c/c1eecc61558d
[2/2] virtio: sanitise virtio endian wrappers
      https://git.kernel.org/will/kvmtool/c/b17552ee6c97

Cheers,