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 C90 instead of C89 when referr...



details:   https://anonhg.NetBSD.org/src/rev/2521dfec45b3
branches:  trunk
changeset: 1029125:2521dfec45b3
user:      rillig <rillig%NetBSD.org@localhost>
date:      Wed Dec 22 14:25:35 2021 +0000

description:
lint: use C90 instead of C89 when referring to the C standard

diffstat:

 tests/usr.bin/xlint/lint1/msg_035.c   |   4 ++--
 tests/usr.bin/xlint/lint1/msg_265.c   |  13 ++++++++-----
 tests/usr.bin/xlint/lint1/msg_265.exp |   4 ++--
 tests/usr.bin/xlint/lint1/msg_312.c   |  10 ++++++----
 tests/usr.bin/xlint/lint1/msg_312.exp |   2 +-
 usr.bin/xlint/lint1/decl.c            |   8 ++++----
 usr.bin/xlint/lint1/err.c             |   8 ++++----
 usr.bin/xlint/lint1/lex.c             |   8 ++++----
 8 files changed, 31 insertions(+), 26 deletions(-)

diffs (168 lines):

diff -r 422c7c2f3c7e -r 2521dfec45b3 tests/usr.bin/xlint/lint1/msg_035.c
--- a/tests/usr.bin/xlint/lint1/msg_035.c       Wed Dec 22 14:11:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_035.c       Wed Dec 22 14:25:35 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_035.c,v 1.9 2021/05/02 21:22:09 rillig Exp $       */
+/*     $NetBSD: msg_035.c,v 1.10 2021/12/22 14:25:35 rillig Exp $      */
 # 3 "msg_035.c"
 
 // Test for message: illegal bit-field type '%s' [35]
@@ -9,7 +9,7 @@
 /*
  * In traditional C, only unsigned int is a portable bit-field type.
  *
- * In C89, only int, signed int and unsigned int are allowed (3.5.2.1p7).
+ * In C90, only int, signed int and unsigned int are allowed (3.5.2.1p7).
  *
  * In C99 and C11, only _Bool, signed int and unsigned int are allowed,
  * plus implementation-defined types (6.7.2.1p5).
diff -r 422c7c2f3c7e -r 2521dfec45b3 tests/usr.bin/xlint/lint1/msg_265.c
--- a/tests/usr.bin/xlint/lint1/msg_265.c       Wed Dec 22 14:11:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_265.c       Wed Dec 22 14:25:35 2021 +0000
@@ -1,13 +1,16 @@
-/*     $NetBSD: msg_265.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
+/*     $NetBSD: msg_265.c,v 1.4 2021/12/22 14:25:35 rillig Exp $       */
 # 3 "msg_265.c"
 
-/* Test for message: %s C does not support 'long long' [265] */
+/* Test for message: %s does not support 'long long' [265] */
 
 /* lint1-flags: -w */
 
-long long unsupported_variable;                        /* expect: 265 */
+/* expect+1: C90 does not support 'long long' [265] */
+long long unsupported_variable;
 
 /*LONGLONG*/
-long long suppressed_variable;
+long long suppressed_variable,
+    second_suppressed_variable;
 
-long long another_unsupported_variable;                /* expect: 265 */
+/* expect+1: C90 does not support 'long long' [265] */
+long long another_unsupported_variable;
diff -r 422c7c2f3c7e -r 2521dfec45b3 tests/usr.bin/xlint/lint1/msg_265.exp
--- a/tests/usr.bin/xlint/lint1/msg_265.exp     Wed Dec 22 14:11:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_265.exp     Wed Dec 22 14:25:35 2021 +0000
@@ -1,2 +1,2 @@
-msg_265.c(8): warning: c89 C does not support 'long long' [265]
-msg_265.c(13): warning: c89 C does not support 'long long' [265]
+msg_265.c(9): warning: C90 does not support 'long long' [265]
+msg_265.c(16): warning: C90 does not support 'long long' [265]
diff -r 422c7c2f3c7e -r 2521dfec45b3 tests/usr.bin/xlint/lint1/msg_312.c
--- a/tests/usr.bin/xlint/lint1/msg_312.c       Wed Dec 22 14:11:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_312.c       Wed Dec 22 14:25:35 2021 +0000
@@ -1,7 +1,9 @@
-/*     $NetBSD: msg_312.c,v 1.2 2021/02/21 09:07:58 rillig Exp $       */
+/*     $NetBSD: msg_312.c,v 1.3 2021/12/22 14:25:35 rillig Exp $       */
 # 3 "msg_312.c"
 
-// Test for message: %s C does not support // comments [312]
+/* Test for message: %s does not support // comments [312] */
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+/* lint1-flags: -tw */
+
+/* expect+1: traditional C does not support // comments [312] */
+// C99 comment
diff -r 422c7c2f3c7e -r 2521dfec45b3 tests/usr.bin/xlint/lint1/msg_312.exp
--- a/tests/usr.bin/xlint/lint1/msg_312.exp     Wed Dec 22 14:11:14 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_312.exp     Wed Dec 22 14:25:35 2021 +0000
@@ -1,1 +1,1 @@
-msg_312.c(6): error: syntax error ':' [249]
+msg_312.c(9): warning: traditional C does not support // comments [312]
diff -r 422c7c2f3c7e -r 2521dfec45b3 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Wed Dec 22 14:11:14 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Wed Dec 22 14:25:35 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.242 2021/11/01 19:10:07 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.243 2021/12/22 14:25:35 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.242 2021/11/01 19:10:07 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.243 2021/12/22 14:25:35 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -365,8 +365,8 @@
                t = QUAD;
                dcs->d_rank_mod = NOTSPEC;
                if (!quadflg)
-                       /* %s C does not support 'long long' */
-                       c99ism(265, tflag ? "traditional" : "c89");
+                       /* %s does not support 'long long' */
+                       c99ism(265, tflag ? "traditional C" : "C90");
        }
 
        if (dcs->d_type != NULL && dcs->d_type->t_typedef) {
diff -r 422c7c2f3c7e -r 2521dfec45b3 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Wed Dec 22 14:11:14 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Wed Dec 22 14:25:35 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.150 2021/12/22 00:45:53 rillig Exp $ */
+/*     $NetBSD: err.c,v 1.151 2021/12/22 14:25:35 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.150 2021/12/22 00:45:53 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.151 2021/12/22 14:25:35 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -319,7 +319,7 @@
        "\\\" inside character constants undefined in traditional C", /* 262 */
        "\\? undefined in traditional C",                             /* 263 */
        "\\v undefined in traditional C",                             /* 264 */
-       "%s C does not support 'long long'",                          /* 265 */
+       "%s does not support 'long long'",                            /* 265 */
        "'long double' is illegal in traditional C",                  /* 266 */
        "shift equal to size of object",                              /* 267 */
        "variable declared inline: %s",                               /* 268 */
@@ -366,7 +366,7 @@
        "extra bits set to 0 in conversion of '%s' to '%s', op '%s'", /* 309 */
        "symbol renaming can't be used on function arguments",        /* 310 */
        "symbol renaming can't be used on automatic variables",       /* 311 */
-       "%s C does not support // comments",                          /* 312 */
+       "%s does not support // comments",                            /* 312 */
        "struct or union member name in initializer is a C9X feature",/* 313 */
        "%s is not a structure or a union",                           /* 314 */
        "GCC style struct or union member name in initializer",       /* 315 */
diff -r 422c7c2f3c7e -r 2521dfec45b3 usr.bin/xlint/lint1/lex.c
--- a/usr.bin/xlint/lint1/lex.c Wed Dec 22 14:11:14 2021 +0000
+++ b/usr.bin/xlint/lint1/lex.c Wed Dec 22 14:25:35 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.90 2021/12/15 15:20:51 christos Exp $ */
+/* $NetBSD: lex.c,v 1.91 2021/12/22 14:25:35 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: lex.c,v 1.90 2021/12/15 15:20:51 christos Exp $");
+__RCSID("$NetBSD: lex.c,v 1.91 2021/12/22 14:25:35 rillig Exp $");
 #endif
 
 #include <ctype.h>
@@ -1228,8 +1228,8 @@
        int c;
 
        if (!Sflag && !gflag)
-               /* %s C does not support // comments */
-               gnuism(312, tflag ? "traditional" : "ANSI");
+               /* %s does not support // comments */
+               gnuism(312, tflag ? "traditional C" : "C90");
 
        while ((c = inpc()) != EOF && c != '\n')
                continue;



Home | Main Index | Thread Index | Old Index