Module Name: src Committed By: rillig Date: Sun Jan 31 11:44:48 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_117.c msg_117.exp msg_120.c msg_120.exp src/usr.bin/xlint/lint1: check-msgs.lua err.c tree.c Log Message: lint: mention the operator in messages about bit shifts To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_117.c \ src/tests/usr.bin/xlint/lint1/msg_120.c cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_117.exp \ src/tests/usr.bin/xlint/lint1/msg_120.exp cvs rdiff -u -r1.5 -r1.6 src/usr.bin/xlint/lint1/check-msgs.lua cvs rdiff -u -r1.74 -r1.75 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.199 -r1.200 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_117.c diff -u src/tests/usr.bin/xlint/lint1/msg_117.c:1.3 src/tests/usr.bin/xlint/lint1/msg_117.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_117.c:1.3 Sun Jan 31 11:12:07 2021 +++ src/tests/usr.bin/xlint/lint1/msg_117.c Sun Jan 31 11:44:48 2021 @@ -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 */ Index: src/tests/usr.bin/xlint/lint1/msg_120.c diff -u src/tests/usr.bin/xlint/lint1/msg_120.c:1.3 src/tests/usr.bin/xlint/lint1/msg_120.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_120.c:1.3 Sun Jan 31 11:12:07 2021 +++ src/tests/usr.bin/xlint/lint1/msg_120.c Sun Jan 31 11:44:48 2021 @@ -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 */ Index: src/tests/usr.bin/xlint/lint1/msg_117.exp diff -u src/tests/usr.bin/xlint/lint1/msg_117.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_117.exp:1.3 --- src/tests/usr.bin/xlint/lint1/msg_117.exp:1.2 Sat Jan 9 14:37:16 2021 +++ src/tests/usr.bin/xlint/lint1/msg_117.exp Sun Jan 31 11:44:48 2021 @@ -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] Index: src/tests/usr.bin/xlint/lint1/msg_120.exp diff -u src/tests/usr.bin/xlint/lint1/msg_120.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_120.exp:1.3 --- src/tests/usr.bin/xlint/lint1/msg_120.exp:1.2 Sat Jan 9 14:37:16 2021 +++ src/tests/usr.bin/xlint/lint1/msg_120.exp Sun Jan 31 11:44:48 2021 @@ -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] Index: src/usr.bin/xlint/lint1/check-msgs.lua diff -u src/usr.bin/xlint/lint1/check-msgs.lua:1.5 src/usr.bin/xlint/lint1/check-msgs.lua:1.6 --- src/usr.bin/xlint/lint1/check-msgs.lua:1.5 Sat Jan 2 01:12:38 2021 +++ src/usr.bin/xlint/lint1/check-msgs.lua Sun Jan 31 11:44:48 2021 @@ -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 @@ local function check_message(fname, line 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") Index: src/usr.bin/xlint/lint1/err.c diff -u src/usr.bin/xlint/lint1/err.c:1.74 src/usr.bin/xlint/lint1/err.c:1.75 --- src/usr.bin/xlint/lint1/err.c:1.74 Sun Jan 31 11:23:01 2021 +++ src/usr.bin/xlint/lint1/err.c Sun Jan 31 11:44:48 2021 @@ -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 @@ const char *msgs[] = { "%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 */ Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.199 src/usr.bin/xlint/lint1/tree.c:1.200 --- src/usr.bin/xlint/lint1/tree.c:1.199 Sat Jan 30 23:15:32 2021 +++ src/usr.bin/xlint/lint1/tree.c Sun Jan 31 11:44:48 2021 @@ -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 @@ typeok_shr(const mod_t *mp, * 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 @@ typeok_op(op_t op, const mod_t *mp, int 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: