Module Name: src Committed By: rillig Date: Sun Feb 28 20:17:14 UTC 2021
Modified Files: src/distrib/sets/lists/tests: mi src/tests/usr.bin/xlint/lint1: Makefile t_integration.sh Added Files: src/tests/usr.bin/xlint/lint1: d_c99_union_init5.c Log Message: lint: add test to demonstrate that PR bin/20264 has been fixed To generate a diff of this commit: cvs rdiff -u -r1.1022 -r1.1023 src/distrib/sets/lists/tests/mi cvs rdiff -u -r1.32 -r1.33 src/tests/usr.bin/xlint/lint1/Makefile cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/xlint/lint1/d_c99_union_init5.c cvs rdiff -u -r1.30 -r1.31 src/tests/usr.bin/xlint/lint1/t_integration.sh Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/distrib/sets/lists/tests/mi diff -u src/distrib/sets/lists/tests/mi:1.1022 src/distrib/sets/lists/tests/mi:1.1023 --- src/distrib/sets/lists/tests/mi:1.1022 Sun Feb 21 21:26:26 2021 +++ src/distrib/sets/lists/tests/mi Sun Feb 28 20:17:13 2021 @@ -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 Index: src/tests/usr.bin/xlint/lint1/Makefile diff -u src/tests/usr.bin/xlint/lint1/Makefile:1.32 src/tests/usr.bin/xlint/lint1/Makefile:1.33 --- src/tests/usr.bin/xlint/lint1/Makefile:1.32 Sun Feb 21 08:05:51 2021 +++ src/tests/usr.bin/xlint/lint1/Makefile Sun Feb 28 20:17:14 2021 @@ -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_init1.c 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 Index: src/tests/usr.bin/xlint/lint1/t_integration.sh diff -u src/tests/usr.bin/xlint/lint1/t_integration.sh:1.30 src/tests/usr.bin/xlint/lint1/t_integration.sh:1.31 --- src/tests/usr.bin/xlint/lint1/t_integration.sh:1.30 Sun Feb 21 08:05:51 2021 +++ src/tests/usr.bin/xlint/lint1/t_integration.sh Sun Feb 28 20:17:14 2021 @@ -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_init 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 Added files: Index: src/tests/usr.bin/xlint/lint1/d_c99_union_init5.c diff -u /dev/null src/tests/usr.bin/xlint/lint1/d_c99_union_init5.c:1.1 --- /dev/null Sun Feb 28 20:17:14 2021 +++ src/tests/usr.bin/xlint/lint1/d_c99_union_init5.c Sun Feb 28 20:17:14 2021 @@ -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 } +};