Module Name:    src
Committed By:   rillig
Date:           Sun Jan 31 14:05:00 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: d_constant_conv2.exp d_gcc_extension.exp
            d_type_conv1.exp d_type_conv2.exp d_type_conv3.exp msg_259.c
            msg_259.exp
        src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: reword message 259 about function argument conversion

The words "due to prototype" are an anachronism from the 1990s.
Nowadays every function is defined using a prototype, which makes these
words redundant.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp \
    src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp \
    src/tests/usr.bin/xlint/lint1/d_type_conv1.exp \
    src/tests/usr.bin/xlint/lint1/d_type_conv2.exp \
    src/tests/usr.bin/xlint/lint1/d_type_conv3.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_259.c \
    src/tests/usr.bin/xlint/lint1/msg_259.exp
cvs rdiff -u -r1.76 -r1.77 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.203 -r1.204 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/d_constant_conv2.exp
diff -u src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.2 src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.3
--- src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp:1.2	Sun Jan 31 13:56:14 2021
+++ src/tests/usr.bin/xlint/lint1/d_constant_conv2.exp	Sun Jan 31 14:05:00 2021
@@ -1 +1 @@
-(11): warning: conversion from 'double' to 'unsigned int' due to prototype, arg #1 [259]
+(11): warning: argument #1 is converted from 'double' to 'unsigned int' [259]
Index: src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp
diff -u src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp:1.2 src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp:1.3
--- src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp:1.2	Sun Jan 31 13:56:14 2021
+++ src/tests/usr.bin/xlint/lint1/d_gcc_extension.exp	Sun Jan 31 14:05:00 2021
@@ -1,2 +1,2 @@
-(7): warning: conversion from 'double' to 'long double' due to prototype, arg #1 [259]
-(7): warning: conversion from 'double' to 'long double' due to prototype, arg #1 [259]
+(7): warning: argument #1 is converted from 'double' to 'long double' [259]
+(7): warning: argument #1 is converted from 'double' to 'long double' [259]
Index: src/tests/usr.bin/xlint/lint1/d_type_conv1.exp
diff -u src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.2 src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.3
--- src/tests/usr.bin/xlint/lint1/d_type_conv1.exp:1.2	Sun Jan 31 13:56:14 2021
+++ src/tests/usr.bin/xlint/lint1/d_type_conv1.exp	Sun Jan 31 14:05:00 2021
@@ -1 +1 @@
-(13): warning: conversion from 'long long' to 'unsigned int' due to prototype, arg #1 [259]
+(13): warning: argument #1 is converted from 'long long' to 'unsigned int' [259]
Index: src/tests/usr.bin/xlint/lint1/d_type_conv2.exp
diff -u src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.2 src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.3
--- src/tests/usr.bin/xlint/lint1/d_type_conv2.exp:1.2	Sun Jan 31 13:56:14 2021
+++ src/tests/usr.bin/xlint/lint1/d_type_conv2.exp	Sun Jan 31 14:05:00 2021
@@ -1 +1 @@
-(13): warning: conversion from 'double' to 'float' due to prototype, arg #1 [259]
+(13): warning: argument #1 is converted from 'double' to 'float' [259]
Index: src/tests/usr.bin/xlint/lint1/d_type_conv3.exp
diff -u src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.2 src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.3
--- src/tests/usr.bin/xlint/lint1/d_type_conv3.exp:1.2	Sun Jan 31 13:56:14 2021
+++ src/tests/usr.bin/xlint/lint1/d_type_conv3.exp	Sun Jan 31 14:05:00 2021
@@ -1,2 +1,2 @@
-(12): warning: conversion from 'long long' to 'unsigned int' due to prototype, arg #1 [259]
+(12): warning: argument #1 is converted from 'long long' to 'unsigned int' [259]
 (12): warning: conversion of 'long long' to 'unsigned int' is out of range, arg #1 [295]

Index: src/tests/usr.bin/xlint/lint1/msg_259.c
diff -u src/tests/usr.bin/xlint/lint1/msg_259.c:1.3 src/tests/usr.bin/xlint/lint1/msg_259.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_259.c:1.3	Sun Jan 31 13:56:14 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.c	Sun Jan 31 14:05:00 2021
@@ -1,7 +1,7 @@
-/*	$NetBSD: msg_259.c,v 1.3 2021/01/31 13:56:14 rillig Exp $	*/
+/*	$NetBSD: msg_259.c,v 1.4 2021/01/31 14:05:00 rillig Exp $	*/
 # 3 "msg_259.c"
 
-// Test for message: conversion from '%s' to '%s' due to prototype, arg #%d [259]
+// Test for message: argument #%d is converted from '%s' to '%s' [259]
 
 /* lint1-extra-flags: -h */
 
Index: src/tests/usr.bin/xlint/lint1/msg_259.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_259.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_259.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_259.exp:1.3	Sun Jan 31 13:56:14 2021
+++ src/tests/usr.bin/xlint/lint1/msg_259.exp	Sun Jan 31 14:05:00 2021
@@ -1 +1 @@
-msg_259.c(22): warning: conversion from 'long' to 'int' due to prototype, arg #1 [259]
+msg_259.c(22): warning: argument #1 is converted from 'long' to 'int' [259]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.76 src/usr.bin/xlint/lint1/err.c:1.77
--- src/usr.bin/xlint/lint1/err.c:1.76	Sun Jan 31 13:56:14 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Jan 31 14:05:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: err.c,v 1.76 2021/01/31 13:56:14 rillig Exp $	*/
+/*	$NetBSD: err.c,v 1.77 2021/01/31 14:05:00 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: err.c,v 1.76 2021/01/31 13:56:14 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.77 2021/01/31 14:05:00 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -318,7 +318,7 @@ const	char *msgs[] = {
 	"unterminated comment",					      /* 256 */
 	"extra characters in lint comment",			      /* 257 */
 	"unterminated string constant",				      /* 258 */
-	"conversion from '%s' to '%s' due to prototype, arg #%d",     /* 259 */
+	"argument #%d is converted from '%s' to '%s'",		      /* 259 */
 	"previous declaration of %s",				      /* 260 */
 	"previous definition of %s",				      /* 261 */
 	"\\\" inside character constants undefined in traditional C", /* 262 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.203 src/usr.bin/xlint/lint1/tree.c:1.204
--- src/usr.bin/xlint/lint1/tree.c:1.203	Sun Jan 31 13:56:14 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Jan 31 14:05:00 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: tree.c,v 1.203 2021/01/31 13:56:14 rillig Exp $	*/
+/*	$NetBSD: tree.c,v 1.204 2021/01/31 14:05:00 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.203 2021/01/31 13:56:14 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.204 2021/01/31 14:05:00 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2101,9 +2101,9 @@ check_prototype_conversion(int arg, tspe
 	    psize(nt) != psize(ot)) {
 		/* representation and/or width change */
 		if (!is_integer(ot) || psize(ot) > psize(INT)) {
-			/* conv. from '%s' to '%s' due to prototype, arg #%d */
+			/* argument #%d is converted from '%s' to '%s' */
 			warning(259,
-			    type_name(tn->tn_type), type_name(tp), arg);
+			    arg, type_name(tn->tn_type), type_name(tp));
 		}
 	} else if (hflag) {
 		/*
@@ -2118,9 +2118,9 @@ check_prototype_conversion(int arg, tspe
 		    msb(ptn->tn_val->v_quad, ot, -1) == 0) {
 			/* ok */
 		} else {
-			/* conv. from '%s' to '%s' due to prototype, arg #%d */
+			/* argument #%d is converted from '%s' to '%s' */
 			warning(259,
-			    type_name(tn->tn_type), type_name(tp), arg);
+			    arg, type_name(tn->tn_type), type_name(tp));
 		}
 	}
 }

Reply via email to