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 type information to message 126



details:   https://anonhg.NetBSD.org/src/rev/85ad842e552f
branches:  trunk
changeset: 1017982:85ad842e552f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 17 17:14:34 2021 +0000

description:
lint: add type information to message 126

diffstat:

 tests/usr.bin/xlint/lint1/msg_126.exp |   2 +-
 usr.bin/xlint/lint1/err.c             |   6 +++---
 usr.bin/xlint/lint1/tree.c            |  12 ++++++------
 3 files changed, 10 insertions(+), 10 deletions(-)

diffs (76 lines):

diff -r ab3a6c2a89d2 -r 85ad842e552f tests/usr.bin/xlint/lint1/msg_126.exp
--- a/tests/usr.bin/xlint/lint1/msg_126.exp     Sun Jan 17 16:51:12 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_126.exp     Sun Jan 17 17:14:34 2021 +0000
@@ -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]
diff -r ab3a6c2a89d2 -r 85ad842e552f usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Jan 17 16:51:12 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Jan 17 17:14:34 2021 +0000
@@ -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 @@
        "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 */
diff -r ab3a6c2a89d2 -r 85ad842e552f usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jan 17 16:51:12 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jan 17 17:14:34 2021 +0000
@@ -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 @@
 
        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 @@
                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;
 }
 



Home | Main Index | Thread Index | Old Index