Module Name: src
Committed By: rillig
Date: Tue Apr 6 21:10:37 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_132.c msg_132.exp
Log Message:
tests/lint: demonstrate wrong warning about losing accuracy
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_132.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_132.exp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/xlint/lint1/msg_132.c
diff -u src/tests/usr.bin/xlint/lint1/msg_132.c:1.3 src/tests/usr.bin/xlint/lint1/msg_132.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_132.c:1.3 Sun Feb 28 21:39:17 2021
+++ src/tests/usr.bin/xlint/lint1/msg_132.c Tue Apr 6 21:10:37 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_132.c,v 1.3 2021/02/28 21:39:17 rillig Exp $ */
+/* $NetBSD: msg_132.c,v 1.4 2021/04/06 21:10:37 rillig Exp $ */
# 3 "msg_132.c"
// Test for message: conversion from '%s' to '%s' may lose accuracy [132]
@@ -62,3 +62,10 @@ convert_signed(i8 v8, i16 v16, i32 v32,
v64 = v16;
v64 = v32;
}
+
+_Bool
+to_bool(long a, long b)
+{
+ /* seen in fp_lib.h, function wideRightShiftWithSticky */
+ return a | b; /* expect: 132 *//*FIXME*/
+}
Index: src/tests/usr.bin/xlint/lint1/msg_132.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_132.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_132.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_132.exp:1.2 Sun Feb 28 21:39:17 2021
+++ src/tests/usr.bin/xlint/lint1/msg_132.exp Tue Apr 6 21:10:37 2021
@@ -10,3 +10,4 @@ msg_132.c(51): warning: conversion from
msg_132.c(54): warning: conversion from 'int' to 'short' may lose accuracy [132]
msg_132.c(55): warning: conversion from 'long long' to 'short' may lose accuracy [132]
msg_132.c(59): warning: conversion from 'long long' to 'int' may lose accuracy [132]
+msg_132.c(70): warning: conversion from 'long' to '_Bool' may lose accuracy [132]