On Wed, Jun 18, 2025 at 08:31:36AM +0200, Peter Krempa via Devel wrote:
> From: Peter Krempa <pkre...@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 <pkre...@redhat.com>
> ---
>  src/util/virsocketaddr.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Reviewed-by: Pavel Hrdina <phrd...@redhat.com>

Attachment: signature.asc
Description: PGP signature

Reply via email to