Module Name: src Committed By: rillig Date: Mon Mar 14 20:25:26 UTC 2022
Modified Files: src/tests/usr.bin/xlint/lint1: msg_230_uchar.c msg_230_uchar.exp Log Message: tests/lint: fix test about "non-portable character constant" on uchar The warning is wrong, and it has been for a long time. For now just fix the test to match the actual output. Seen on evbarm, which is one of the platforms where a plain char is unsigned. Noticed by Martin. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_230_uchar.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_230_uchar.c diff -u src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.7 src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.8 --- src/tests/usr.bin/xlint/lint1/msg_230_uchar.c:1.7 Sat Feb 26 11:13:01 2022 +++ src/tests/usr.bin/xlint/lint1/msg_230_uchar.c Mon Mar 14 20:25:26 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_230_uchar.c,v 1.7 2022/02/26 11:13:01 rillig Exp $ */ +/* $NetBSD: msg_230_uchar.c,v 1.8 2022/03/14 20:25:26 rillig Exp $ */ # 3 "msg_230_uchar.c" // Test for message: nonportable character comparison '%s %d' [230] @@ -125,8 +125,10 @@ compare_with_character_literal(char ch) * interpreted using the type 'char' on the exact same platform as * where the comparison takes place. */ + /* expect+1: warning: nonportable character comparison '== 128' [230] */ if (ch == '\200') return; + /* expect+1: warning: nonportable character comparison '== 255' [230] */ if (ch == '\377') return; if (ch == '\000') Index: src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp diff -u src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp:1.4 --- src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp:1.3 Thu Dec 16 20:23:40 2021 +++ src/tests/usr.bin/xlint/lint1/msg_230_uchar.exp Mon Mar 14 20:25:26 2022 @@ -17,3 +17,5 @@ msg_230_uchar.c(99): warning: comparison msg_230_uchar.c(109): warning: nonportable character comparison '>= 128' [230] msg_230_uchar.c(113): warning: nonportable character comparison '> 128' [230] msg_230_uchar.c(116): warning: nonportable character comparison '>= 129' [230] +msg_230_uchar.c(129): warning: nonportable character comparison '== 128' [230] +msg_230_uchar.c(132): warning: nonportable character comparison '== 255' [230]