Module Name: src
Committed By: rillig
Date: Thu Sep 2 17:29:19 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: msg_259.c msg_259.exp
src/usr.bin/xlint/lint1: tree.c
Log Message:
lint: fix unintended warning for converting long long to signed char
To generate a diff of this commit:
cvs rdiff -u -r1.17 -r1.18 src/tests/usr.bin/xlint/lint1/msg_259.c
cvs rdiff -u -r1.14 -r1.15 src/tests/usr.bin/xlint/lint1/msg_259.exp
cvs rdiff -u -r1.367 -r1.368 src/usr.bin/xlint/lint1/tree.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/msg_259.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.17 src/tests/usr.bin/xlint/lint1/msg_259.c:1.18
--- src/tests/usr.bin/xlint/lint1/msg_259.c:1.17 Thu Sep 2 17:26:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.c Thu Sep 2 17:29:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: msg_259.c,v 1.17 2021/09/02 17:26:43 rillig Exp $ */
+/* $NetBSD: msg_259.c,v 1.18 2021/09/02 17:29:19 rillig Exp $ */
# 3 "msg_259.c"
// Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259]
@@ -74,9 +74,7 @@ small_integer_types(char c, signed char
signed_char(us);
signed_char(si);
signed_char(ui);
- /* expect+1: warning: argument #1 is converted from 'long long' to 'signed char' due to prototype [259] */
signed_char(sll);
- /* expect+1: warning: argument #1 is converted from 'unsigned long long' to 'signed char' due to prototype [259] */
signed_char(ull);
unsigned_char(c);
Index: src/tests/usr.bin/xlint/lint1/msg_259.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_259.exp:1.14 src/tests/usr.bin/xlint/lint1/msg_259.exp:1.15
--- src/tests/usr.bin/xlint/lint1/msg_259.exp:1.14 Thu Sep 2 17:26:43 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.exp Thu Sep 2 17:29:19 2021
@@ -1,26 +1,24 @@
msg_259.c(41): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-msg_259.c(78): warning: argument #1 is converted from 'long long' to 'signed char' due to prototype [259]
-msg_259.c(80): warning: argument #1 is converted from 'unsigned long long' to 'signed char' due to prototype [259]
-msg_259.c(129): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
-msg_259.c(132): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
-msg_259.c(135): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259]
-msg_259.c(144): warning: argument #1 is converted from 'long' to 'unsigned long' due to prototype [259]
-msg_259.c(146): warning: argument #1 is converted from 'long long' to 'unsigned long' due to prototype [259]
-msg_259.c(155): warning: argument #1 is converted from 'long' to 'unsigned long long' due to prototype [259]
-msg_259.c(158): warning: argument #1 is converted from 'long long' to 'unsigned long long' due to prototype [259]
-msg_259.c(165): warning: argument #1 is converted from 'unsigned int' to 'int' due to prototype [259]
-msg_259.c(167): warning: argument #1 is converted from 'unsigned long' to 'int' due to prototype [259]
-msg_259.c(169): warning: argument #1 is converted from 'unsigned long long' to 'int' due to prototype [259]
-msg_259.c(172): warning: argument #1 is converted from 'unsigned long' to 'long' due to prototype [259]
-msg_259.c(174): warning: argument #1 is converted from 'unsigned long long' to 'long' due to prototype [259]
-msg_259.c(177): warning: argument #1 is converted from 'unsigned long' to 'long long' due to prototype [259]
-msg_259.c(179): warning: argument #1 is converted from 'unsigned long long' to 'long long' due to prototype [259]
-msg_259.c(187): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-msg_259.c(189): warning: argument #1 is converted from 'long long' to 'int' due to prototype [259]
-msg_259.c(193): warning: argument #1 is converted from 'long long' to 'long' due to prototype [259]
-msg_259.c(196): warning: argument #1 is converted from 'long' to 'long long' due to prototype [259]
-msg_259.c(205): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
-msg_259.c(207): warning: argument #1 is converted from 'unsigned long long' to 'unsigned int' due to prototype [259]
-msg_259.c(211): warning: argument #1 is converted from 'unsigned long long' to 'unsigned long' due to prototype [259]
-msg_259.c(214): warning: argument #1 is converted from 'unsigned long' to 'unsigned long long' due to prototype [259]
-msg_259.c(228): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
+msg_259.c(127): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
+msg_259.c(130): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
+msg_259.c(133): warning: argument #1 is converted from 'long long' to 'unsigned int' due to prototype [259]
+msg_259.c(142): warning: argument #1 is converted from 'long' to 'unsigned long' due to prototype [259]
+msg_259.c(144): warning: argument #1 is converted from 'long long' to 'unsigned long' due to prototype [259]
+msg_259.c(153): warning: argument #1 is converted from 'long' to 'unsigned long long' due to prototype [259]
+msg_259.c(156): warning: argument #1 is converted from 'long long' to 'unsigned long long' due to prototype [259]
+msg_259.c(163): warning: argument #1 is converted from 'unsigned int' to 'int' due to prototype [259]
+msg_259.c(165): warning: argument #1 is converted from 'unsigned long' to 'int' due to prototype [259]
+msg_259.c(167): warning: argument #1 is converted from 'unsigned long long' to 'int' due to prototype [259]
+msg_259.c(170): warning: argument #1 is converted from 'unsigned long' to 'long' due to prototype [259]
+msg_259.c(172): warning: argument #1 is converted from 'unsigned long long' to 'long' due to prototype [259]
+msg_259.c(175): warning: argument #1 is converted from 'unsigned long' to 'long long' due to prototype [259]
+msg_259.c(177): warning: argument #1 is converted from 'unsigned long long' to 'long long' due to prototype [259]
+msg_259.c(185): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
+msg_259.c(187): warning: argument #1 is converted from 'long long' to 'int' due to prototype [259]
+msg_259.c(191): warning: argument #1 is converted from 'long long' to 'long' due to prototype [259]
+msg_259.c(194): warning: argument #1 is converted from 'long' to 'long long' due to prototype [259]
+msg_259.c(203): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
+msg_259.c(205): warning: argument #1 is converted from 'unsigned long long' to 'unsigned int' due to prototype [259]
+msg_259.c(209): warning: argument #1 is converted from 'unsigned long long' to 'unsigned long' due to prototype [259]
+msg_259.c(212): warning: argument #1 is converted from 'unsigned long' to 'unsigned long long' due to prototype [259]
+msg_259.c(226): warning: argument #1 is converted from 'unsigned long' to 'unsigned int' due to prototype [259]
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.367 src/usr.bin/xlint/lint1/tree.c:1.368
--- src/usr.bin/xlint/lint1/tree.c:1.367 Thu Sep 2 16:31:01 2021
+++ src/usr.bin/xlint/lint1/tree.c Thu Sep 2 17:29:19 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.367 2021/09/02 16:31:01 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.368 2021/09/02 17:29:19 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.367 2021/09/02 16:31:01 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.368 2021/09/02 17:29:19 rillig Exp $");
#endif
#include <float.h>
@@ -2034,8 +2034,8 @@ check_prototype_conversion(int arg, tspe
* would be useless, because functions declared the old style
* can't expect char/short arguments.
*/
- /* XXX: what about SCHAR? */
- if (nt == CHAR || nt == UCHAR || nt == SHORT || nt == USHORT)
+ if (nt == CHAR || nt == SCHAR || nt == UCHAR ||
+ nt == SHORT || nt == USHORT)
return;
/* apply the default promotion */