Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/xlint/lint1 lint: mention the operator in messages a...
details: https://anonhg.NetBSD.org/src/rev/f8175b0bf5ee
branches: trunk
changeset: 950792:f8175b0bf5ee
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Jan 31 11:44:48 2021 +0000
description:
lint: mention the operator in messages about bit shifts
diffstat:
tests/usr.bin/xlint/lint1/msg_117.c | 4 ++--
tests/usr.bin/xlint/lint1/msg_117.exp | 8 ++++----
tests/usr.bin/xlint/lint1/msg_120.c | 4 ++--
tests/usr.bin/xlint/lint1/msg_120.exp | 8 ++++----
usr.bin/xlint/lint1/check-msgs.lua | 3 +--
usr.bin/xlint/lint1/err.c | 8 ++++----
usr.bin/xlint/lint1/tree.c | 16 ++++++++--------
7 files changed, 25 insertions(+), 26 deletions(-)
diffs (148 lines):
diff -r 0782dff71424 -r f8175b0bf5ee tests/usr.bin/xlint/lint1/msg_117.c
--- a/tests/usr.bin/xlint/lint1/msg_117.c Sun Jan 31 11:23:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_117.c Sun Jan 31 11:44:48 2021 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_117.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
+/* $NetBSD: msg_117.c,v 1.4 2021/01/31 11:44:48 rillig Exp $ */
# 3 "msg_117.c"
-// Test for message: bitwise operation on signed value possibly nonportable [117]
+// Test for message: bitwise '%s' on signed value possibly nonportable [117]
/* lint1-extra-flags: -p */
diff -r 0782dff71424 -r f8175b0bf5ee tests/usr.bin/xlint/lint1/msg_117.exp
--- a/tests/usr.bin/xlint/lint1/msg_117.exp Sun Jan 31 11:23:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_117.exp Sun Jan 31 11:44:48 2021 +0000
@@ -1,6 +1,6 @@
-msg_117.c(11): warning: bitwise operation on signed value possibly nonportable [117]
-msg_117.c(23): warning: bitwise operation on signed value nonportable [120]
-msg_117.c(29): warning: bitwise operation on signed value possibly nonportable [117]
+msg_117.c(11): warning: bitwise '>>' on signed value possibly nonportable [117]
+msg_117.c(23): warning: bitwise '>>' on signed value nonportable [120]
+msg_117.c(29): warning: bitwise '>>' on signed value possibly nonportable [117]
msg_117.c(29): warning: shift greater than size of object [122]
-msg_117.c(35): warning: bitwise operation on signed value possibly nonportable [117]
+msg_117.c(35): warning: bitwise '>>' on signed value possibly nonportable [117]
msg_117.c(35): warning: negative shift [121]
diff -r 0782dff71424 -r f8175b0bf5ee tests/usr.bin/xlint/lint1/msg_120.c
--- a/tests/usr.bin/xlint/lint1/msg_120.c Sun Jan 31 11:23:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_120.c Sun Jan 31 11:44:48 2021 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_120.c,v 1.3 2021/01/31 11:12:07 rillig Exp $ */
+/* $NetBSD: msg_120.c,v 1.4 2021/01/31 11:44:48 rillig Exp $ */
# 3 "msg_120.c"
-// Test for message: bitwise operation on signed value nonportable [120]
+// Test for message: bitwise '%s' on signed value nonportable [120]
/* lint1-extra-flags: -p */
diff -r 0782dff71424 -r f8175b0bf5ee tests/usr.bin/xlint/lint1/msg_120.exp
--- a/tests/usr.bin/xlint/lint1/msg_120.exp Sun Jan 31 11:23:01 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_120.exp Sun Jan 31 11:44:48 2021 +0000
@@ -1,6 +1,6 @@
-msg_120.c(11): warning: bitwise operation on signed value possibly nonportable [117]
-msg_120.c(23): warning: bitwise operation on signed value nonportable [120]
-msg_120.c(29): warning: bitwise operation on signed value possibly nonportable [117]
+msg_120.c(11): warning: bitwise '>>' on signed value possibly nonportable [117]
+msg_120.c(23): warning: bitwise '>>' on signed value nonportable [120]
+msg_120.c(29): warning: bitwise '>>' on signed value possibly nonportable [117]
msg_120.c(29): warning: shift greater than size of object [122]
-msg_120.c(35): warning: bitwise operation on signed value possibly nonportable [117]
+msg_120.c(35): warning: bitwise '>>' on signed value possibly nonportable [117]
msg_120.c(35): warning: negative shift [121]
diff -r 0782dff71424 -r f8175b0bf5ee usr.bin/xlint/lint1/check-msgs.lua
--- a/usr.bin/xlint/lint1/check-msgs.lua Sun Jan 31 11:23:01 2021 +0000
+++ b/usr.bin/xlint/lint1/check-msgs.lua Sun Jan 31 11:44:48 2021 +0000
@@ -1,5 +1,5 @@
#! /usr/bin/lua
--- $NetBSD: check-msgs.lua,v 1.5 2021/01/02 01:12:38 rillig Exp $
+-- $NetBSD: check-msgs.lua,v 1.6 2021/01/31 11:44:48 rillig Exp $
--[[
@@ -41,7 +41,6 @@
msg = string.gsub(msg, "\\(.)", "%1")
comment = string.gsub(comment, "arg%.", "argument")
- comment = string.gsub(comment, "bitop%.", "bitwise operation")
comment = string.gsub(comment, "comb%.", "combination")
comment = string.gsub(comment, "conv%.", "conversion")
comment = string.gsub(comment, "decl%.", "declaration")
diff -r 0782dff71424 -r f8175b0bf5ee usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Jan 31 11:23:01 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Jan 31 11:44:48 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.74 2021/01/31 11:23:01 rillig Exp $ */
+/* $NetBSD: err.c,v 1.75 2021/01/31 11:44:48 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.74 2021/01/31 11:23:01 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.75 2021/01/31 11:44:48 rillig Exp $");
#endif
#include <sys/types.h>
@@ -176,10 +176,10 @@
"%soperand of '%s' must be lvalue", /* 114 */
"%soperand of '%s' must be modifiable lvalue", /* 115 */
"illegal pointer subtraction", /* 116 */
- "bitwise operation on signed value possibly nonportable", /* 117 */
+ "bitwise '%s' on signed value possibly nonportable", /* 117 */
"semantics of '%s' change in ANSI C; use explicit cast", /* 118 */
"conversion of '%s' to '%s' is out of range", /* 119 */
- "bitwise operation on signed value nonportable", /* 120 */
+ "bitwise '%s' on signed value nonportable", /* 120 */
"negative shift", /* 121 */
"shift greater than size of object", /* 122 */
"illegal combination of %s (%s) and %s (%s), op %s", /* 123 */
diff -r 0782dff71424 -r f8175b0bf5ee usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Sun Jan 31 11:23:01 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Sun Jan 31 11:44:48 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.199 2021/01/30 23:15:32 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.200 2021/01/31 11:44:48 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.199 2021/01/30 23:15:32 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.200 2021/01/31 11:44:48 rillig Exp $");
#endif
#include <float.h>
@@ -889,11 +889,11 @@
* the operation is (possibly) nonportable.
*/
if (ln->tn_op != CON) {
- /* bitop. on signed value possibly nonportable */
- warning(117);
+ /* bitwise '%s' on signed value possibly nonportable */
+ warning(117, mp->m_name);
} else if (ln->tn_val->v_quad < 0) {
- /* bitop. on signed value nonportable */
- warning(120);
+ /* bitwise '%s' on signed value nonportable */
+ warning(120, mp->m_name);
}
} else if (!tflag && !sflag && !is_uinteger(olt) && is_uinteger(ort)) {
/*
@@ -1397,8 +1397,8 @@
goto assign;
case SHRASS:
if (pflag && !is_uinteger(lt) && !(tflag && is_uinteger(rt))) {
- /* bitop. on signed value possibly nonportable */
- warning(117);
+ /* bitwise '%s' on signed value possibly nonportable */
+ warning(117, mp->m_name);
}
goto assign;
case ANDASS:
Home |
Main Index |
Thread Index |
Old Index