Source-Changes-HG archive

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

[src/trunk]: src lint: add test to demonstrate that PR bin/20264 has been fixed



details:   https://anonhg.NetBSD.org/src/rev/d5ed8377cb5f
branches:  trunk
changeset: 959910:d5ed8377cb5f
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Feb 28 20:17:13 2021 +0000

description:
lint: add test to demonstrate that PR bin/20264 has been fixed

diffstat:

 distrib/sets/lists/tests/mi                   |   3 ++-
 tests/usr.bin/xlint/lint1/Makefile            |   3 ++-
 tests/usr.bin/xlint/lint1/d_c99_union_init5.c |  18 ++++++++++++++++++
 tests/usr.bin/xlint/lint1/t_integration.sh    |   3 ++-
 4 files changed, 24 insertions(+), 3 deletions(-)

diffs (73 lines):

diff -r 98e8bd912c54 -r d5ed8377cb5f distrib/sets/lists/tests/mi
--- a/distrib/sets/lists/tests/mi       Sun Feb 28 20:04:52 2021 +0000
+++ b/distrib/sets/lists/tests/mi       Sun Feb 28 20:17:13 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1022 2021/02/21 21:26:26 rillig Exp $
+# $NetBSD: mi,v 1.1023 2021/02/28 20:17:13 rillig Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -5785,6 +5785,7 @@
 ./usr/tests/usr.bin/xlint/lint1/d_c99_union_init2.c            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_union_init3.c            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c99_union_init4.c            tests-usr.bin-tests     compattestfile,atf
+./usr/tests/usr.bin/xlint/lint1/d_c99_union_init5.c            tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c9x_array_init.c             tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_c9x_recursive_init.c         tests-usr.bin-tests     compattestfile,atf
 ./usr/tests/usr.bin/xlint/lint1/d_cast_fun_array_param.c       tests-usr.bin-tests     compattestfile,atf
diff -r 98e8bd912c54 -r d5ed8377cb5f tests/usr.bin/xlint/lint1/Makefile
--- a/tests/usr.bin/xlint/lint1/Makefile        Sun Feb 28 20:04:52 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/Makefile        Sun Feb 28 20:17:13 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.32 2021/02/21 08:05:51 rillig Exp $
+# $NetBSD: Makefile,v 1.33 2021/02/28 20:17:14 rillig Exp $
 
 NOMAN=         # defined
 
@@ -39,6 +39,7 @@
 FILES+=                d_c99_union_init2.c
 FILES+=                d_c99_union_init3.c
 FILES+=                d_c99_union_init4.c
+FILES+=                d_c99_union_init5.c
 FILES+=                d_c9x_array_init.c
 FILES+=                d_c9x_recursive_init.c
 FILES+=                d_cast_fun_array_param.c
diff -r 98e8bd912c54 -r d5ed8377cb5f tests/usr.bin/xlint/lint1/d_c99_union_init5.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_union_init5.c     Sun Feb 28 20:17:13 2021 +0000
@@ -0,0 +1,18 @@
+/* $NetBSD: d_c99_union_init5.c,v 1.1 2021/02/28 20:17:14 rillig Exp $ */
+# 3 "d_c99_union_init5.c"
+
+/*
+ * PR bin/20264: lint(1) has problems with named member initialization
+ *
+ * Has been fixed somewhere between 2005.12.24.20.47.56 and
+ * 2006.12.19.19.06.44.
+*/
+
+union mist {
+       char *p;
+       int a[1];
+};
+
+union mist xx = {
+    .a = { 7 }
+};
diff -r 98e8bd912c54 -r d5ed8377cb5f tests/usr.bin/xlint/lint1/t_integration.sh
--- a/tests/usr.bin/xlint/lint1/t_integration.sh        Sun Feb 28 20:04:52 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/t_integration.sh        Sun Feb 28 20:17:13 2021 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: t_integration.sh,v 1.30 2021/02/21 08:05:51 rillig Exp $
+# $NetBSD: t_integration.sh,v 1.31 2021/02/28 20:17:14 rillig Exp $
 #
 # Copyright (c) 2008, 2010 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -102,6 +102,7 @@
 test_case c99_nested_struct
 test_case c99_union_cast
 test_case c99_union_init4
+test_case c99_union_init5
 test_case cast_fun_array_param
 test_case cast_typeof
 test_case decl_old_style_arguments



Home | Main Index | Thread Index | Old Index