Module Name: src
Committed By: rillig
Date: Sun Aug 15 13:02:20 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_117.c msg_117.exp
Log Message:
tests/lint: demonstrate wrong warning about signed '>>'
Seen in libdes/ostr2key.c(81).
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/tests/usr.bin/xlint/lint1/msg_117.c
cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_117.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_117.c
diff -u src/tests/usr.bin/xlint/lint1/msg_117.c:1.5 src/tests/usr.bin/xlint/lint1/msg_117.c:1.6
--- src/tests/usr.bin/xlint/lint1/msg_117.c:1.5 Mon Apr 5 01:35:34 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.c Sun Aug 15 13:02:20 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_117.c,v 1.5 2021/04/05 01:35:34 rillig Exp $ */
+/* $NetBSD: msg_117.c,v 1.6 2021/08/15 13:02:20 rillig Exp $ */
# 3 "msg_117.c"
// Test for message: bitwise '%s' on signed value possibly nonportable [117]
@@ -34,3 +34,11 @@ shr_rhs_constant_negative(int a)
{
return a >> -0x1234; /* expect: 117 *//* expect: 121 */
}
+
+unsigned int
+shr_unsigned_char(unsigned char uc)
+{
+ /* FIXME: This value cannot actually be negative. */
+ /* expect+1: warning: bitwise '>>' on signed value possibly nonportable [117] */
+ return uc >> 4;
+}
Index: src/tests/usr.bin/xlint/lint1/msg_117.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_117.exp:1.4 src/tests/usr.bin/xlint/lint1/msg_117.exp:1.5
--- src/tests/usr.bin/xlint/lint1/msg_117.exp:1.4 Tue Apr 6 21:32:57 2021
+++ src/tests/usr.bin/xlint/lint1/msg_117.exp Sun Aug 15 13:02:20 2021
@@ -4,3 +4,4 @@ msg_117.c(29): warning: bitwise '>>' on
msg_117.c(29): warning: shift amount 4660 is greater than bit-size 32 of 'int' [122]
msg_117.c(35): warning: bitwise '>>' on signed value possibly nonportable [117]
msg_117.c(35): warning: negative shift [121]
+msg_117.c(43): warning: bitwise '>>' on signed value possibly nonportable [117]