Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/tests/lib/libc/misc Avoid warnings about tautological left s...
details: https://anonhg.NetBSD.org/src/rev/2b8c3bee06d9
branches: trunk
changeset: 464903:2b8c3bee06d9
user: joerg <joerg%NetBSD.org@localhost>
date: Mon Oct 28 18:10:22 2019 +0000
description:
Avoid warnings about tautological left shifts as conditional.
diffstat:
tests/lib/libc/misc/t_ubsan.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diffs (54 lines):
diff -r 79dc92acca9f -r 2b8c3bee06d9 tests/lib/libc/misc/t_ubsan.c
--- a/tests/lib/libc/misc/t_ubsan.c Mon Oct 28 18:08:44 2019 +0000
+++ b/tests/lib/libc/misc/t_ubsan.c Mon Oct 28 18:10:22 2019 +0000
@@ -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 @@
{
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 @@
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 @@
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 @@
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)
Home |
Main Index |
Thread Index |
Old Index