Module Name: src
Committed By: rillig
Date: Sun Jul 25 22:31:22 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_342.c msg_342.exp
Log Message:
tests/lint: cover code in ckctype.c
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_342.c \
src/tests/usr.bin/xlint/lint1/msg_342.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_342.c
diff -u src/tests/usr.bin/xlint/lint1/msg_342.c:1.1 src/tests/usr.bin/xlint/lint1/msg_342.c:1.2
--- src/tests/usr.bin/xlint/lint1/msg_342.c:1.1 Mon Apr 5 02:05:47 2021
+++ src/tests/usr.bin/xlint/lint1/msg_342.c Sun Jul 25 22:31:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_342.c,v 1.1 2021/04/05 02:05:47 rillig Exp $ */
+/* $NetBSD: msg_342.c,v 1.2 2021/07/25 22:31:22 rillig Exp $ */
# 3 "msg_341.c"
// Test for message: argument to '%s' must be cast to 'unsigned char', not to '%s' [342]
@@ -12,11 +12,57 @@
extern const unsigned short *_ctype_tab_;
extern const short *_tolower_tab_;
extern const short *_toupper_tab_;
+int isalnum(int);
+int isalpha(int);
+int isblank(int);
+int iscntrl(int);
+int isdigit(int);
+int isgraph(int);
+int islower(int);
+int isprint(int);
+int ispunct(int);
int isspace(int);
+int isupper(int);
+int isxdigit(int);
+int tolower(int);
+int toupper(int);
void sink(int);
void
+cover_is_ctype_function(char c)
+{
+ /* expect+1: warning: argument to 'isalnum' must be 'unsigned char' or EOF, not 'char' [341] */
+ isalnum(c);
+ /* expect+1: warning: argument to 'isalpha' must be 'unsigned char' or EOF, not 'char' [341] */
+ isalpha(c);
+ /* expect+1: warning: argument to 'isblank' must be 'unsigned char' or EOF, not 'char' [341] */
+ isblank(c);
+ /* expect+1: warning: argument to 'iscntrl' must be 'unsigned char' or EOF, not 'char' [341] */
+ iscntrl(c);
+ /* expect+1: warning: argument to 'isdigit' must be 'unsigned char' or EOF, not 'char' [341] */
+ isdigit(c);
+ /* expect+1: warning: argument to 'isgraph' must be 'unsigned char' or EOF, not 'char' [341] */
+ isgraph(c);
+ /* expect+1: warning: argument to 'islower' must be 'unsigned char' or EOF, not 'char' [341] */
+ islower(c);
+ /* expect+1: warning: argument to 'isprint' must be 'unsigned char' or EOF, not 'char' [341] */
+ isprint(c);
+ /* expect+1: warning: argument to 'ispunct' must be 'unsigned char' or EOF, not 'char' [341] */
+ ispunct(c);
+ /* expect+1: warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341] */
+ isspace(c);
+ /* expect+1: warning: argument to 'isupper' must be 'unsigned char' or EOF, not 'char' [341] */
+ isupper(c);
+ /* expect+1: warning: argument to 'isxdigit' must be 'unsigned char' or EOF, not 'char' [341] */
+ isxdigit(c);
+ /* expect+1: warning: argument to 'tolower' must be 'unsigned char' or EOF, not 'char' [341] */
+ tolower(c);
+ /* expect+1: warning: argument to 'toupper' must be 'unsigned char' or EOF, not 'char' [341] */
+ toupper(c);
+}
+
+void
function_call_char(char c)
{
Index: src/tests/usr.bin/xlint/lint1/msg_342.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_342.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_342.exp:1.2
--- src/tests/usr.bin/xlint/lint1/msg_342.exp:1.1 Mon Apr 5 02:05:47 2021
+++ src/tests/usr.bin/xlint/lint1/msg_342.exp Sun Jul 25 22:31:22 2021
@@ -1,6 +1,20 @@
-msg_341.c(24): warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(33): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'int' [342]
-msg_341.c(36): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' [342]
-msg_341.c(67): warning: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' [341]
-msg_341.c(73): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' [342]
-msg_341.c(76): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' [342]
+msg_341.c(36): warning: argument to 'isalnum' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(38): warning: argument to 'isalpha' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(40): warning: argument to 'isblank' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(42): warning: argument to 'iscntrl' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(44): warning: argument to 'isdigit' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(46): warning: argument to 'isgraph' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(48): warning: argument to 'islower' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(50): warning: argument to 'isprint' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(52): warning: argument to 'ispunct' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(54): warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(56): warning: argument to 'isupper' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(58): warning: argument to 'isxdigit' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(60): warning: argument to 'tolower' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(62): warning: argument to 'toupper' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(70): warning: argument to 'isspace' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(79): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'int' [342]
+msg_341.c(82): warning: argument to 'isspace' must be cast to 'unsigned char', not to 'unsigned int' [342]
+msg_341.c(113): warning: argument to 'function from <ctype.h>' must be 'unsigned char' or EOF, not 'char' [341]
+msg_341.c(119): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'int' [342]
+msg_341.c(122): warning: argument to 'function from <ctype.h>' must be cast to 'unsigned char', not to 'unsigned int' [342]