Module Name: src Committed By: rillig Date: Sat Dec 2 23:54:49 UTC 2023
Modified Files: src/tests/usr.bin/xlint/lint1: platform_schar.c platform_uchar.c Log Message: tests/lint: add more test cases for nonportable character comparison To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/platform_schar.c cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/platform_uchar.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/usr.bin/xlint/lint1/platform_schar.c diff -u src/tests/usr.bin/xlint/lint1/platform_schar.c:1.4 src/tests/usr.bin/xlint/lint1/platform_schar.c:1.5 --- src/tests/usr.bin/xlint/lint1/platform_schar.c:1.4 Wed Feb 22 22:30:40 2023 +++ src/tests/usr.bin/xlint/lint1/platform_schar.c Sat Dec 2 23:54:49 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: platform_schar.c,v 1.4 2023/02/22 22:30:40 rillig Exp $ */ +/* $NetBSD: platform_schar.c,v 1.5 2023/12/02 23:54:49 rillig Exp $ */ # 3 "platform_schar.c" /* @@ -6,9 +6,14 @@ * representation as signed char. */ -/* lint1-extra-flags: -c -h -a -p -b -r -z */ +/* lint1-extra-flags: -c -h -a -p -b -r -z -X 161 */ /* lint1-only-if: schar */ -/* CONSTCOND */ /* expect+1: warning: nonportable character comparison '-128 < ?' [230] */ -typedef int is_signed[(char)'\200' < (char)'\177' ? 1 : -1]; +typedef int char_char[(char)'\200' < (char)'\177' ? 1 : -1]; +/* expect+1: warning: nonportable character comparison '-128 < ?' [230] */ +typedef int char_int[(char)'\200' < (char)127 ? 1 : -1]; +/* expect+1: warning: nonportable character comparison '-128 < ?' [230] */ +typedef int int_char[(char)-128 < (char)'\177' ? 1 : -1]; +/* expect+1: warning: nonportable character comparison '-128 < ?' [230] */ +typedef int int_int[(char)-128 < (char)127 ? 1 : -1]; Index: src/tests/usr.bin/xlint/lint1/platform_uchar.c diff -u src/tests/usr.bin/xlint/lint1/platform_uchar.c:1.3 src/tests/usr.bin/xlint/lint1/platform_uchar.c:1.4 --- src/tests/usr.bin/xlint/lint1/platform_uchar.c:1.3 Wed Feb 22 22:12:35 2023 +++ src/tests/usr.bin/xlint/lint1/platform_uchar.c Sat Dec 2 23:54:49 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: platform_uchar.c,v 1.3 2023/02/22 22:12:35 rillig Exp $ */ +/* $NetBSD: platform_uchar.c,v 1.4 2023/12/02 23:54:49 rillig Exp $ */ # 3 "platform_uchar.c" /* @@ -6,9 +6,14 @@ * representation as unsigned char. */ -/* lint1-extra-flags: -c -h -a -p -b -r -z */ +/* lint1-extra-flags: -c -h -a -p -b -r -z -X 161 */ /* lint1-only-if: uchar */ -/* CONSTCOND */ /* expect+1: warning: nonportable character comparison '< 128' [230] */ -typedef int is_unsigned[(char)'\177' < (char)'\200' ? 1 : -1]; +typedef int char_char[(char)'\177' < (char)'\200' ? 1 : -1]; +/* expect+1: warning: nonportable character comparison '< 128' [230] */ +typedef int int_char[(char)127 < (char)'\200' ? 1 : -1]; +/* expect+1: warning: nonportable character comparison '< 128' [230] */ +typedef int char_int[(char)'\177' < (char)128 ? 1 : -1]; +/* expect+1: warning: nonportable character comparison '< 128' [230] */ +typedef int int_int[(char)127 < (char)128 ? 1 : -1];