Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: fix outdated comments



details:   https://anonhg.NetBSD.org/src/rev/74529d702149
branches:  trunk
changeset: 953912:74529d702149
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Mar 23 23:12:21 2021 +0000

description:
tests/lint: fix outdated comments

diffstat:

 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c |  8 ++++----
 tests/usr.bin/xlint/lint1/d_c99_init.c        |  3 +--
 tests/usr.bin/xlint/lint1/d_c99_init.exp      |  6 +++---
 3 files changed, 8 insertions(+), 9 deletions(-)

diffs (53 lines):

diff -r 5f792bc2633c -r 74529d702149 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
--- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Tue Mar 23 22:58:08 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Tue Mar 23 23:12:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_bool_strict.c,v 1.26 2021/03/21 14:36:59 rillig Exp $    */
+/*     $NetBSD: d_c99_bool_strict.c,v 1.27 2021/03/23 23:12:21 rillig Exp $    */
 # 3 "d_c99_bool_strict.c"
 
 /*
@@ -151,10 +151,10 @@
        /*
         * Without strict bool mode, these two variants of an expression can
         * occur when a preprocessor macro is either defined to 1 or left
-        * empty, as in lint1/ops.def.
+        * empty (since C99), as in lint1/ops.def.
         *
-        * TODO: figure out an elegant way to achieve the same effect in
-        *  strict bool mode.
+        * In strict bool mode, the resulting expression can be compared
+        * against 0 to achieve the same effect (so +0 != 0 or 1 + 0 != 0).
         */
        BINARY_PLUS = (1 + 0) ? 100 : 101, /* expect: 331 */
        UNARY_PLUS = (+0) ? 100 : 101,  /* expect: 331 */
diff -r 5f792bc2633c -r 74529d702149 tests/usr.bin/xlint/lint1/d_c99_init.c
--- a/tests/usr.bin/xlint/lint1/d_c99_init.c    Tue Mar 23 22:58:08 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.c    Tue Mar 23 23:12:21 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_init.c,v 1.12 2021/03/20 08:59:46 rillig Exp $   */
+/*     $NetBSD: d_c99_init.c,v 1.13 2021/03/23 23:12:21 rillig Exp $   */
 # 3 "d_c99_init.c"
 
 /*
@@ -47,7 +47,6 @@
 initialization_with_redundant_braces(any arg)
 {
        any local = { arg };    /* expect: 185 */
-       // TODO: message 185 needs to be reworded to "cannot initialize '%s' from '%s'".
        use(&arg);
 }
 
diff -r 5f792bc2633c -r 74529d702149 tests/usr.bin/xlint/lint1/d_c99_init.exp
--- a/tests/usr.bin/xlint/lint1/d_c99_init.exp  Tue Mar 23 22:58:08 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.exp  Tue Mar 23 23:12:21 2021 +0000
@@ -1,6 +1,6 @@
 d_c99_init.c(22): error: invalid initializer type int [176]
 d_c99_init.c(23): error: too many initializers [174]
 d_c99_init.c(49): error: cannot initialize 'pointer to const void' from 'struct any' [185]
-d_c99_init.c(66): error: too many array initializers, expected 3 [173]
-d_c99_init.c(131): error: syntax error 'named member must only be used with struct/union' [249]
-d_c99_init.c(143): error: invalid initializer type int [176]
+d_c99_init.c(65): error: too many array initializers, expected 3 [173]
+d_c99_init.c(130): error: syntax error 'named member must only be used with struct/union' [249]
+d_c99_init.c(142): error: invalid initializer type int [176]



Home | Main Index | Thread Index | Old Index