Skip to content

Add QEMU_WARN_UNUSED_RESULT function attribute

Manos Pitsidianakis qemu-arm qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Add QEMU_WARN_UNUSED_RESULT attributeinclude/qemu/compiler.h+14 -02 replies
2/2Add warn_unused_result attr to AUD_register_cardaudio/audio.h hw/arm/omap2.c hw/input/tsc210x.c+15 -310 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Add QEMU_WARN_UNUSED_RESULT function attribute

Functions that return a value to indicate success or failure can be decorated with the warn_unused_result attribute. GCC will stop compilation if a caller does not check the return value after calling such a function. This was not possible to spot statically before, but Coverity detects this kind of bug. I was prompted by

https://lore.kernel.org/qemu-devel/CAFEAcA_TS-B0gc-DUYT6BaKnm8Uauhsx3rW2dmVNUgTToVjSJg@mail.gmail.com/

to prevent this from happening in the future.

This patch series depends on <[email protected]>

https://lore.kernel.org/qemu-devel/[email protected]/

Manos Pitsidianakis (2):
Add QEMU_WARN_UNUSED_RESULT attribute Add warn_unused_result attr to AUD_register_card

 audio/audio.h           |  2 +-
 hw/arm/omap2.c          |  8 +++++++-
 hw/input/tsc210x.c      |  8 +++++++-
 include/qemu/compiler.h | 14 ++++++++++++++
 4 files changed, 29 insertions(+), 3 deletions(-)

base-commit: ad6ef0a42e314a8c6ac6c96d5f6e607a1e5644b5
prerequisite-patch-id: 484ec9f7f6109c10d4be0484fe8e3c2550c415f4

Signature · 1 line
2.39.2