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: demonstrate wrong warn...



details:   https://anonhg.NetBSD.org/src/rev/036211b1a7aa
branches:  trunk
changeset: 961088:036211b1a7aa
user:      rillig <rillig%NetBSD.org@localhost>
date:      Fri Apr 09 22:08:14 2021 +0000

description:
tests/lint: demonstrate wrong warning when initializing a string

diffstat:

 tests/usr.bin/xlint/lint1/d_c99_init.c   |  9 ++++++++-
 tests/usr.bin/xlint/lint1/d_c99_init.exp |  1 +
 2 files changed, 9 insertions(+), 1 deletions(-)

diffs (28 lines):

diff -r f32068a87213 -r 036211b1a7aa tests/usr.bin/xlint/lint1/d_c99_init.c
--- a/tests/usr.bin/xlint/lint1/d_c99_init.c    Fri Apr 09 21:42:12 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.c    Fri Apr 09 22:08:14 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_init.c,v 1.31 2021/04/02 12:16:50 rillig Exp $   */
+/*     $NetBSD: d_c99_init.c,v 1.32 2021/04/09 22:08:14 rillig Exp $   */
 # 3 "d_c99_init.c"
 
 /*
@@ -385,3 +385,10 @@
        { .x = 3 },             /* expect: scalar type cannot use designator */
        { [1] = 4 },            /* expect: scalar type cannot use designator */
 };
+
+
+/* Seen in pcidevs_data.h, variable 'pci_words'. */
+const char string_initialized_with_braced_literal[] = {
+       /* FIXME: *//* expect+1: illegal combination of integer (char) and pointer (pointer to char) [183] */
+       "initializer",
+};
diff -r f32068a87213 -r 036211b1a7aa tests/usr.bin/xlint/lint1/d_c99_init.exp
--- a/tests/usr.bin/xlint/lint1/d_c99_init.exp  Fri Apr 09 21:42:12 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.exp  Fri Apr 09 22:08:14 2021 +0000
@@ -24,3 +24,4 @@
 d_c99_init.c(381): error: syntax error 'scalar type cannot use designator' [249]
 d_c99_init.c(385): error: syntax error 'scalar type cannot use designator' [249]
 d_c99_init.c(386): error: syntax error 'scalar type cannot use designator' [249]
+d_c99_init.c(393): warning: illegal combination of integer (char) and pointer (pointer to char) [183]



Home | Main Index | Thread Index | Old Index