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: use standard quotes in messages 20...



details:   https://anonhg.NetBSD.org/src/rev/5c3298e68499
branches:  trunk
changeset: 1023073:5c3298e68499
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Aug 22 13:52:19 2021 +0000

description:
lint: use standard quotes in messages 203 and 271

diffstat:

 tests/usr.bin/xlint/lint1/msg_203.c   |  19 +++++++++++++++----
 tests/usr.bin/xlint/lint1/msg_203.exp |   2 +-
 tests/usr.bin/xlint/lint1/msg_271.c   |   6 +++---
 tests/usr.bin/xlint/lint1/msg_271.exp |   2 +-
 usr.bin/xlint/lint1/err.c             |   8 ++++----
 usr.bin/xlint/lint1/func.c            |   8 ++++----
 6 files changed, 28 insertions(+), 17 deletions(-)

diffs (132 lines):

diff -r 9870dd3a8917 -r 5c3298e68499 tests/usr.bin/xlint/lint1/msg_203.c
--- a/tests/usr.bin/xlint/lint1/msg_203.c       Sun Aug 22 13:45:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_203.c       Sun Aug 22 13:52:19 2021 +0000
@@ -1,7 +1,18 @@
-/*     $NetBSD: msg_203.c,v 1.2 2021/02/21 09:07:58 rillig Exp $       */
+/*     $NetBSD: msg_203.c,v 1.3 2021/08/22 13:52:19 rillig Exp $       */
 # 3 "msg_203.c"
 
-// Test for message: case label must be of type `int' in traditional C [203]
+/* Test for message: case label must be of type 'int' in traditional C [203] */
+
+/* lint1-flags: -tw */
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+example(x)
+       int x;
+{
+       switch (x) {
+       case (char)3:
+               break;
+       /* expect+1: warning: case label must be of type 'int' in traditional C [203] */
+       case 4L:
+               break;
+       }
+}
diff -r 9870dd3a8917 -r 5c3298e68499 tests/usr.bin/xlint/lint1/msg_203.exp
--- a/tests/usr.bin/xlint/lint1/msg_203.exp     Sun Aug 22 13:45:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_203.exp     Sun Aug 22 13:52:19 2021 +0000
@@ -1,1 +1,1 @@
-msg_203.c(6): error: syntax error ':' [249]
+msg_203.c(15): warning: case label must be of type 'int' in traditional C [203]
diff -r 9870dd3a8917 -r 5c3298e68499 tests/usr.bin/xlint/lint1/msg_271.c
--- a/tests/usr.bin/xlint/lint1/msg_271.c       Sun Aug 22 13:45:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_271.c       Sun Aug 22 13:52:19 2021 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_271.c,v 1.3 2021/08/22 13:45:56 rillig Exp $       */
+/*     $NetBSD: msg_271.c,v 1.4 2021/08/22 13:52:19 rillig Exp $       */
 # 3 "msg_271.c"
 
-/* Test for message: switch expression must be of type `int' in traditional C [271] */
+/* Test for message: switch expression must be of type 'int' in traditional C [271] */
 
 /* lint1-flags: -tw */
 
@@ -9,7 +9,7 @@
        long long_int;
        unsigned unsigned_int;
 {
-       /* expect+1: warning: switch expression must be of type `int' in traditional C [271] */
+       /* expect+1: warning: switch expression must be of type 'int' in traditional C [271] */
        switch (long_int) {
        case 3:
                return 1;
diff -r 9870dd3a8917 -r 5c3298e68499 tests/usr.bin/xlint/lint1/msg_271.exp
--- a/tests/usr.bin/xlint/lint1/msg_271.exp     Sun Aug 22 13:45:56 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_271.exp     Sun Aug 22 13:52:19 2021 +0000
@@ -1,1 +1,1 @@
-msg_271.c(13): warning: switch expression must be of type `int' in traditional C [271]
+msg_271.c(13): warning: switch expression must be of type 'int' in traditional C [271]
diff -r 9870dd3a8917 -r 5c3298e68499 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Aug 22 13:45:56 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Aug 22 13:52:19 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.137 2021/08/16 06:49:56 rillig Exp $ */
+/*     $NetBSD: err.c,v 1.138 2021/08/22 13:52:19 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.137 2021/08/16 06:49:56 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.138 2021/08/22 13:52:19 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -257,7 +257,7 @@
        "duplicate case in switch: %lu",                              /* 200 */
        "default outside switch",                                     /* 201 */
        "duplicate default in switch",                                /* 202 */
-       "case label must be of type `int' in traditional C",          /* 203 */
+       "case label must be of type 'int' in traditional C",          /* 203 */
        "controlling expressions must have scalar type",              /* 204 */
        "switch expression must have integral type",                  /* 205 */
        "enumeration value(s) not handled in switch",                 /* 206 */
@@ -325,7 +325,7 @@
        "variable declared inline: %s",                               /* 268 */
        "argument declared inline: %s",                               /* 269 */
        "function prototypes are illegal in traditional C",           /* 270 */
-       "switch expression must be of type `int' in traditional C",   /* 271 */
+       "switch expression must be of type 'int' in traditional C",   /* 271 */
        "empty translation unit",                                     /* 272 */
        "bit-field type '%s' invalid in ANSI C",                      /* 273 */
        "ANSI C forbids comparison of %s with %s",                    /* 274 */
diff -r 9870dd3a8917 -r 5c3298e68499 usr.bin/xlint/lint1/func.c
--- a/usr.bin/xlint/lint1/func.c        Sun Aug 22 13:45:56 2021 +0000
+++ b/usr.bin/xlint/lint1/func.c        Sun Aug 22 13:52:19 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: func.c,v 1.119 2021/08/03 18:44:33 rillig Exp $        */
+/*     $NetBSD: func.c,v 1.120 2021/08/22 13:52:19 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: func.c,v 1.119 2021/08/03 18:44:33 rillig Exp $");
+__RCSID("$NetBSD: func.c,v 1.120 2021/08/22 13:52:19 rillig Exp $");
 #endif
 
 #include <stdlib.h>
@@ -521,7 +521,7 @@
        if (t == LONG || t == ULONG ||
            t == QUAD || t == UQUAD) {
                if (tflag)
-                       /* case label must be of type `int' in traditional C */
+                       /* case label must be of type 'int' in traditional C */
                        warning(203);
        }
 
@@ -697,7 +697,7 @@
        if (tn != NULL && tflag) {
                t = tn->tn_type->t_tspec;
                if (t == LONG || t == ULONG || t == QUAD || t == UQUAD) {
-                       /* switch expr. must be of type `int' in trad. C */
+                       /* switch expr. must be of type 'int' in trad. C */
                        warning(271);
                }
        }



Home | Main Index | Thread Index | Old Index