Module Name: src
Committed By: joerg
Date: Mon Oct 28 18:10:22 UTC 2019
Modified Files:
src/tests/lib/libc/misc: t_ubsan.c
Log Message:
Avoid warnings about tautological left shifts as conditional.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/misc/t_ubsan.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/lib/libc/misc/t_ubsan.c
diff -u src/tests/lib/libc/misc/t_ubsan.c:1.5 src/tests/lib/libc/misc/t_ubsan.c:1.6
--- src/tests/lib/libc/misc/t_ubsan.c:1.5 Wed Feb 20 11:40:41 2019
+++ src/tests/lib/libc/misc/t_ubsan.c Mon Oct 28 18:10:22 2019
@@ -1,4 +1,4 @@
-/* $NetBSD: t_ubsan.c,v 1.5 2019/02/20 11:40:41 kamil Exp $ */
+/* $NetBSD: t_ubsan.c,v 1.6 2019/10/28 18:10:22 joerg Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
#include <sys/cdefs.h>
__COPYRIGHT("@(#) Copyright (c) 2018\
The NetBSD Foundation, inc. All rights reserved.");
-__RCSID("$NetBSD: t_ubsan.c,v 1.5 2019/02/20 11:40:41 kamil Exp $");
+__RCSID("$NetBSD: t_ubsan.c,v 1.6 2019/10/28 18:10:22 joerg Exp $");
#include <sys/types.h>
#include <sys/wait.h>
@@ -602,7 +602,7 @@ test_shift_out_of_bounds_signednessbit(v
{
volatile int32_t a = atoi("1");
- raise((a << 31) ? SIGSEGV : SIGBUS);
+ raise((a << 31) != 0 ? SIGSEGV : SIGBUS);
}
UBSAN_TC_BODY(shift_out_of_bounds_signednessbit, tc)
@@ -626,7 +626,7 @@ test_shift_out_of_bounds_signedoverflow(
volatile int32_t b = atoi("30");
a <<= b;
- raise((a << 10) ? SIGSEGV : SIGBUS);
+ raise((a << 10) != 0 ? SIGSEGV : SIGBUS);
}
UBSAN_TC_BODY(shift_out_of_bounds_signedoverflow, tc)
@@ -648,7 +648,7 @@ test_shift_out_of_bounds_negativeexponen
volatile int32_t a = atoi("1");
volatile int32_t b = atoi("-10");
- raise((a << b) ? SIGSEGV : SIGBUS);
+ raise((a << b) != 0 ? SIGSEGV : SIGBUS);
}
UBSAN_TC_BODY(shift_out_of_bounds_negativeexponent, tc)
@@ -670,7 +670,7 @@ test_shift_out_of_bounds_toolargeexponen
volatile int32_t a = atoi("1");
volatile int32_t b = atoi("40");
- raise((a << b) ? SIGSEGV : SIGBUS);
+ raise((a << b) != 0 ? SIGSEGV : SIGBUS);
}
UBSAN_TC_BODY(shift_out_of_bounds_toolargeexponent, tc)