
18 Jun
2025
18 Jun
'25
3:08 a.m.
On Wed, Jun 18, 2025 at 08:31:36AM +0200, Peter Krempa via Devel wrote:
From: Peter Krempa <pkrempa@redhat.com>
Shifting bits into the sign bit is undefined behaviour in C although both gcc and clang handle it as expected.
Since the value is used as unsigned convert it to unsigned int. For code readability use 'if' statement instead of a ternary.
Closes: https://gitlab.com/libvirt/libvirt/-/issues/785 Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- src/util/virsocketaddr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>