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: add quotes around placeholder in m...
details: https://anonhg.NetBSD.org/src/rev/9fedf8decf28
branches: trunk
changeset: 985414:9fedf8decf28
user: rillig <rillig%NetBSD.org@localhost>
date: Mon Aug 23 06:50:01 2021 +0000
description:
lint: add quotes around placeholder in message 141
diffstat:
tests/usr.bin/xlint/lint1/expr_fold.c | 30 +++++++++++++++---------------
tests/usr.bin/xlint/lint1/expr_fold.exp | 28 ++++++++++++++--------------
tests/usr.bin/xlint/lint1/msg_141.c | 12 ++++++------
tests/usr.bin/xlint/lint1/msg_141.exp | 8 ++++----
usr.bin/xlint/lint1/err.c | 6 +++---
usr.bin/xlint/lint1/tree.c | 6 +++---
6 files changed, 45 insertions(+), 45 deletions(-)
diffs (253 lines):
diff -r 8c01cd67fec2 -r 9fedf8decf28 tests/usr.bin/xlint/lint1/expr_fold.c
--- a/tests/usr.bin/xlint/lint1/expr_fold.c Mon Aug 23 06:32:30 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_fold.c Mon Aug 23 06:50:01 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: expr_fold.c,v 1.4 2021/08/22 21:17:04 rillig Exp $ */
+/* $NetBSD: expr_fold.c,v 1.5 2021/08/23 06:50:01 rillig Exp $ */
# 3 "expr_fold.c"
/*
@@ -67,10 +67,10 @@
/* expect+1: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */
take_int(-2147483648);
- /* expect+2: warning: integer overflow detected, op + [141] */
- /* expect+1: warning: integer overflow detected, op - [141] */
+ /* expect+2: warning: integer overflow detected, op '+' [141] */
+ /* expect+1: warning: integer overflow detected, op '-' [141] */
take_int(-(2147483647 + 1));
- /* expect+1: warning: integer overflow detected, op - [141] */
+ /* expect+1: warning: integer overflow detected, op '-' [141] */
take_int(-(-2147483647 - 1));
/* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */
/* expect+1: warning: conversion of 'long' to 'int' is out of range, arg #1 [295] */
@@ -118,14 +118,14 @@
fold_mult(void)
{
take_int(32767 * 65536);
- /* expect+1: warning: integer overflow detected, op * [141] */
+ /* expect+1: warning: integer overflow detected, op '*' [141] */
take_int(32768 * 65536);
- /* expect+1: warning: integer overflow detected, op * [141] */
+ /* expect+1: warning: integer overflow detected, op '*' [141] */
take_int(65536 * 65536);
take_uint(32767 * 65536U);
take_uint(32768 * 65536U);
- /* expect+1: warning: integer overflow detected, op * [141] */
+ /* expect+1: warning: integer overflow detected, op '*' [141] */
take_uint(65536 * 65536U);
}
@@ -134,7 +134,7 @@
{
/* expect+3: error: division by 0 [139] */
/* XXX: The following message is redundant. */
- /* expect+1: warning: integer overflow detected, op / [141] */
+ /* expect+1: warning: integer overflow detected, op '/' [141] */
take_int(0 / 0);
/* expect+2: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */
@@ -161,13 +161,13 @@
void
fold_plus(void)
{
- /* expect+1: warning: integer overflow detected, op + [141] */
+ /* expect+1: warning: integer overflow detected, op '+' [141] */
take_int(2147483647 + 1);
/* Assume two's complement, so no overflow. */
take_int(-2147483647 + -1);
- /* expect+1: warning: integer overflow detected, op + [141] */
+ /* expect+1: warning: integer overflow detected, op '+' [141] */
take_int(-2147483647 + -2);
/*
@@ -184,26 +184,26 @@
void
fold_minus(void)
{
- /* expect+1: warning: integer overflow detected, op - [141] */
+ /* expect+1: warning: integer overflow detected, op '-' [141] */
take_int(2147483647 - -1);
/* Assume two's complement. */
take_int(-2147483647 - 1);
- /* expect+1: warning: integer overflow detected, op - [141] */
+ /* expect+1: warning: integer overflow detected, op '-' [141] */
take_int(-2147483647 - 2);
/* expect+1: warning: argument #1 is converted from 'long' to 'int' due to prototype [259] */
take_int(0 - 2147483648);
- /* expect+1: warning: integer overflow detected, op - [141] */
+ /* expect+1: warning: integer overflow detected, op '-' [141] */
take_uint(0 - 2147483648U);
}
void
fold_shl(void)
{
- /* expect+1: warning: integer overflow detected, op << [141] */
+ /* expect+1: warning: integer overflow detected, op '<<' [141] */
take_int(1 << 24 << 24);
- /* expect+1: warning: integer overflow detected, op << [141] */
+ /* expect+1: warning: integer overflow detected, op '<<' [141] */
take_uint(1U << 24 << 24);
/* FIXME: undefined behavior in 'fold' at 'uint64_t << 104'. */
diff -r 8c01cd67fec2 -r 9fedf8decf28 tests/usr.bin/xlint/lint1/expr_fold.exp
--- a/tests/usr.bin/xlint/lint1/expr_fold.exp Mon Aug 23 06:32:30 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/expr_fold.exp Mon Aug 23 06:50:01 2021 +0000
@@ -6,9 +6,9 @@
expr_fold.c(46): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
expr_fold.c(64): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
expr_fold.c(68): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-expr_fold.c(72): warning: integer overflow detected, op + [141]
-expr_fold.c(72): warning: integer overflow detected, op - [141]
-expr_fold.c(74): warning: integer overflow detected, op - [141]
+expr_fold.c(72): warning: integer overflow detected, op '+' [141]
+expr_fold.c(72): warning: integer overflow detected, op '-' [141]
+expr_fold.c(74): warning: integer overflow detected, op '-' [141]
expr_fold.c(77): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
expr_fold.c(77): warning: conversion of 'long' to 'int' is out of range, arg #1 [295]
expr_fold.c(82): warning: argument #1 is converted from 'int' to 'unsigned int' due to prototype [259]
@@ -29,11 +29,11 @@
expr_fold.c(111): warning: conversion of negative constant to unsigned type, arg #1 [296]
expr_fold.c(114): warning: argument #1 is converted from 'long' to 'unsigned int' due to prototype [259]
expr_fold.c(114): warning: conversion of negative constant to unsigned type, arg #1 [296]
-expr_fold.c(122): warning: integer overflow detected, op * [141]
-expr_fold.c(124): warning: integer overflow detected, op * [141]
-expr_fold.c(129): warning: integer overflow detected, op * [141]
+expr_fold.c(122): warning: integer overflow detected, op '*' [141]
+expr_fold.c(124): warning: integer overflow detected, op '*' [141]
+expr_fold.c(129): warning: integer overflow detected, op '*' [141]
expr_fold.c(138): error: division by 0 [139]
-expr_fold.c(138): warning: integer overflow detected, op / [141]
+expr_fold.c(138): warning: integer overflow detected, op '/' [141]
expr_fold.c(142): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
expr_fold.c(142): warning: conversion of 'long' to 'int' is out of range, arg #1 [295]
expr_fold.c(149): error: modulus by 0 [140]
@@ -41,13 +41,13 @@
expr_fold.c(153): error: modulus by 0 [140]
expr_fold.c(155): error: modulus by 0 [140]
expr_fold.c(158): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-expr_fold.c(165): warning: integer overflow detected, op + [141]
-expr_fold.c(171): warning: integer overflow detected, op + [141]
-expr_fold.c(188): warning: integer overflow detected, op - [141]
-expr_fold.c(192): warning: integer overflow detected, op - [141]
+expr_fold.c(165): warning: integer overflow detected, op '+' [141]
+expr_fold.c(171): warning: integer overflow detected, op '+' [141]
+expr_fold.c(188): warning: integer overflow detected, op '-' [141]
+expr_fold.c(192): warning: integer overflow detected, op '-' [141]
expr_fold.c(195): warning: argument #1 is converted from 'long' to 'int' due to prototype [259]
-expr_fold.c(197): warning: integer overflow detected, op - [141]
-expr_fold.c(204): warning: integer overflow detected, op << [141]
-expr_fold.c(207): warning: integer overflow detected, op << [141]
+expr_fold.c(197): warning: integer overflow detected, op '-' [141]
+expr_fold.c(204): warning: integer overflow detected, op '<<' [141]
+expr_fold.c(207): warning: integer overflow detected, op '<<' [141]
expr_fold.c(211): warning: shift amount 104 is greater than bit-size 32 of 'unsigned int' [122]
expr_fold.c(223): warning: shift amount 104 is greater than bit-size 32 of 'int' [122]
diff -r 8c01cd67fec2 -r 9fedf8decf28 tests/usr.bin/xlint/lint1/msg_141.c
--- a/tests/usr.bin/xlint/lint1/msg_141.c Mon Aug 23 06:32:30 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_141.c Mon Aug 23 06:50:01 2021 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_141.c,v 1.4 2021/08/23 06:10:27 rillig Exp $ */
+/* $NetBSD: msg_141.c,v 1.5 2021/08/23 06:50:01 rillig Exp $ */
# 3 "msg_141.c"
-// Test for message: integer overflow detected, op %s [141]
+// Test for message: integer overflow detected, op '%s' [141]
/* lint1-extra-flags: -h */
@@ -17,17 +17,17 @@
*/
unsigned int unsigned_int_max = (1u << 31) - 1;
-/* expect+1: warning: integer overflow detected, op + [141] */
+/* expect+1: warning: integer overflow detected, op '+' [141] */
int int_overflow = (1 << 30) + (1 << 30);
-/* expect+2: warning: integer overflow detected, op + [141] */
+/* expect+2: warning: integer overflow detected, op '+' [141] */
/* expect+1: warning: initialization of unsigned with negative constant [221] */
unsigned int intermediate_overflow = (1 << 30) + (1 << 30);
unsigned int no_overflow = (1U << 30) + (1 << 30);
-/* expect+1: warning: integer overflow detected, op - [141] */
+/* expect+1: warning: integer overflow detected, op '-' [141] */
unsigned int unsigned_int_min = 0u - (1u << 31);
-/* expect+1: warning: integer overflow detected, op - [141] */
+/* expect+1: warning: integer overflow detected, op '-' [141] */
unsigned int unsigned_int_min_unary = -(1u << 31);
diff -r 8c01cd67fec2 -r 9fedf8decf28 tests/usr.bin/xlint/lint1/msg_141.exp
--- a/tests/usr.bin/xlint/lint1/msg_141.exp Mon Aug 23 06:32:30 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_141.exp Mon Aug 23 06:50:01 2021 +0000
@@ -1,5 +1,5 @@
-msg_141.c(21): warning: integer overflow detected, op + [141]
-msg_141.c(25): warning: integer overflow detected, op + [141]
+msg_141.c(21): warning: integer overflow detected, op '+' [141]
+msg_141.c(25): warning: integer overflow detected, op '+' [141]
msg_141.c(25): warning: initialization of unsigned with negative constant [221]
-msg_141.c(30): warning: integer overflow detected, op - [141]
-msg_141.c(33): warning: integer overflow detected, op - [141]
+msg_141.c(30): warning: integer overflow detected, op '-' [141]
+msg_141.c(33): warning: integer overflow detected, op '-' [141]
diff -r 8c01cd67fec2 -r 9fedf8decf28 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Mon Aug 23 06:32:30 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Mon Aug 23 06:50:01 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.138 2021/08/22 13:52:19 rillig Exp $ */
+/* $NetBSD: err.c,v 1.139 2021/08/23 06:50:01 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.138 2021/08/22 13:52:19 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.139 2021/08/23 06:50:01 rillig Exp $");
#endif
#include <sys/types.h>
@@ -195,7 +195,7 @@
"unknown operand size, op %s", /* 138 */
"division by 0", /* 139 */
"modulus by 0", /* 140 */
- "integer overflow detected, op %s", /* 141 */
+ "integer overflow detected, op '%s'", /* 141 */
"floating point overflow detected, op %s", /* 142 */
"cannot take size/alignment of incomplete type", /* 143 */
"cannot take size/alignment of function", /* 144 */
diff -r 8c01cd67fec2 -r 9fedf8decf28 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Mon Aug 23 06:32:30 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Mon Aug 23 06:50:01 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.349 2021/08/23 06:32:30 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.350 2021/08/23 06:50:01 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.349 2021/08/23 06:32:30 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.350 2021/08/23 06:50:01 rillig Exp $");
#endif
#include <float.h>
@@ -3142,7 +3142,7 @@
if (ovfl ||
((uint64_t)(q | mask) != ~(uint64_t)0 && (q & ~mask) != 0)) {
if (hflag)
- /* integer overflow detected, op %s */
+ /* integer overflow detected, op '%s' */
warning(141, op_name(tn->tn_op));
}
Home |
Main Index |
Thread Index |
Old Index