Module Name: src Committed By: rillig Date: Sun Jan 17 17:14:34 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_126.exp src/usr.bin/xlint/lint1: err.c tree.c Log Message: lint: add type information to message 126 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_126.exp cvs rdiff -u -r1.68 -r1.69 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.178 -r1.179 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_126.exp diff -u src/tests/usr.bin/xlint/lint1/msg_126.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_126.exp:1.3 --- src/tests/usr.bin/xlint/lint1/msg_126.exp:1.2 Fri Jan 8 21:25:03 2021 +++ src/tests/usr.bin/xlint/lint1/msg_126.exp Sun Jan 17 17:14:34 2021 @@ -1,4 +1,4 @@ -msg_126.c(9): incompatible types in conditional [126] +msg_126.c(9): incompatible types 'pointer to void' and 'double' in conditional [126] msg_126.c(9): warning: function max expects to return value [214] msg_126.c(7): warning: argument cond unused in function max [231] msg_126.c(7): warning: argument ptr unused in function max [231] Index: src/usr.bin/xlint/lint1/err.c diff -u src/usr.bin/xlint/lint1/err.c:1.68 src/usr.bin/xlint/lint1/err.c:1.69 --- src/usr.bin/xlint/lint1/err.c:1.68 Sun Jan 17 11:55:55 2021 +++ src/usr.bin/xlint/lint1/err.c Sun Jan 17 17:14:34 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.68 2021/01/17 11:55:55 rillig Exp $ */ +/* $NetBSD: err.c,v 1.69 2021/01/17 17:14:34 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.68 2021/01/17 11:55:55 rillig Exp $"); +__RCSID("$NetBSD: err.c,v 1.69 2021/01/17 17:14:34 rillig Exp $"); #endif #include <sys/types.h> @@ -185,7 +185,7 @@ const char *msgs[] = { "illegal combination of %s (%s) and %s (%s), op %s", /* 123 */ "illegal pointer combination (%s) and (%s), op %s", /* 124 */ "ANSI C forbids ordered comparisons of pointers to functions",/* 125 */ - "incompatible types in conditional", /* 126 */ + "incompatible types '%s' and '%s' in conditional", /* 126 */ "'&' before array or function: ignored", /* 127 */ "operands have incompatible pointer types, op %s (%s != %s)", /* 128 */ "expression has null effect", /* 129 */ Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.178 src/usr.bin/xlint/lint1/tree.c:1.179 --- src/usr.bin/xlint/lint1/tree.c:1.178 Sun Jan 17 16:32:36 2021 +++ src/usr.bin/xlint/lint1/tree.c Sun Jan 17 17:14:34 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.178 2021/01/17 16:32:36 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.179 2021/01/17 17:14:34 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.178 2021/01/17 16:32:36 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.179 2021/01/17 17:14:34 rillig Exp $"); #endif #include <float.h> @@ -1040,8 +1040,8 @@ typeok_colon(const mod_t *mp, if (lt == VOID || rt == VOID) { if (lt != VOID || rt != VOID) - /* incompatible types in conditional */ - warning(126); + /* incompatible types '%s' and '%s' in conditional */ + warning(126, type_name(ltp), type_name(rtp)); return true; } @@ -1063,8 +1063,8 @@ typeok_colon(const mod_t *mp, return true; } - /* incompatible types in conditional */ - error(126); + /* incompatible types '%s' and '%s' in conditional */ + error(126, type_name(ltp), type_name(rtp)); return false; }