From b2baa50111d645353fa30b4deab0f79d93650c8c Mon Sep 17 00:00:00 2001 From: rillig Date: Tue, 28 Mar 2023 14:44:34 +0000 Subject: [PATCH] lint: warn about extern declarations outside headers https://mail-index.netbsd.org/tech-userlevel/2023/03/15/msg013727.html --- distrib/sets/lists/tests/mi | 3 +- lib/libppath/Makefile | 3 +- lib/libpuffs/Makefile | 3 +- lib/libutil/Makefile | 3 +- .../xlint/lint1/c11_generic_expression.c | 4 +- tests/usr.bin/xlint/lint1/c90.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_anon_union.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_bool.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_bool_strict.c | 4 +- .../xlint/lint1/d_c99_bool_strict_syshdr.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_complex_num.c | 4 +- .../usr.bin/xlint/lint1/d_c99_complex_split.c | 4 +- .../xlint/lint1/d_c99_flex_array_packed.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_for_loops.c | 5 ++- tests/usr.bin/xlint/lint1/d_c99_func.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_init.c | 4 +- .../usr.bin/xlint/lint1/d_c99_nested_struct.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_struct_init.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_union_init1.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_union_init2.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_union_init3.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_union_init4.c | 4 +- tests/usr.bin/xlint/lint1/d_c99_union_init5.c | 4 +- tests/usr.bin/xlint/lint1/d_c9x_array_init.c | 4 +- tests/usr.bin/xlint/lint1/d_cast_lhs.c | 5 ++- tests/usr.bin/xlint/lint1/d_cast_typeof.c | 4 +- .../xlint/lint1/d_compound_literals2.c | 4 +- tests/usr.bin/xlint/lint1/d_constant_conv1.c | 4 +- tests/usr.bin/xlint/lint1/d_constant_conv2.c | 3 +- .../xlint/lint1/d_decl_old_style_arguments.c | 2 + .../xlint/lint1/d_gcc_compound_statements1.c | 4 +- tests/usr.bin/xlint/lint1/d_gcc_extension.c | 4 +- .../xlint/lint1/d_init_array_using_string.c | 4 +- tests/usr.bin/xlint/lint1/d_lint_assert.c | 4 +- tests/usr.bin/xlint/lint1/d_nested_structs.c | 4 +- tests/usr.bin/xlint/lint1/d_packed_structs.c | 4 +- .../xlint/lint1/d_struct_init_nested.c | 4 +- tests/usr.bin/xlint/lint1/d_type_conv1.c | 3 +- tests/usr.bin/xlint/lint1/d_type_conv2.c | 3 +- tests/usr.bin/xlint/lint1/d_type_conv3.c | 3 +- tests/usr.bin/xlint/lint1/d_typefun.c | 4 +- tests/usr.bin/xlint/lint1/decl.c | 4 +- tests/usr.bin/xlint/lint1/decl_arg.c | 4 +- .../xlint/lint1/decl_direct_abstract.c | 4 +- .../usr.bin/xlint/lint1/decl_struct_member.c | 4 +- tests/usr.bin/xlint/lint1/emit.c | 6 +-- tests/usr.bin/xlint/lint1/emit_lp64.c | 4 +- tests/usr.bin/xlint/lint1/expr_binary.c | 3 +- tests/usr.bin/xlint/lint1/expr_binary_trad.c | 4 +- tests/usr.bin/xlint/lint1/expr_fold.c | 4 +- tests/usr.bin/xlint/lint1/expr_precedence.c | 4 +- tests/usr.bin/xlint/lint1/expr_promote.c | 4 +- tests/usr.bin/xlint/lint1/expr_promote_trad.c | 4 +- tests/usr.bin/xlint/lint1/expr_range.c | 4 +- tests/usr.bin/xlint/lint1/expr_sizeof.c | 4 +- tests/usr.bin/xlint/lint1/gcc_attribute.c | 4 +- .../usr.bin/xlint/lint1/gcc_attribute_func.c | 4 +- .../usr.bin/xlint/lint1/gcc_attribute_label.c | 4 +- .../usr.bin/xlint/lint1/gcc_attribute_stmt.c | 4 +- tests/usr.bin/xlint/lint1/gcc_attribute_var.c | 4 +- .../usr.bin/xlint/lint1/gcc_bit_field_types.c | 4 +- .../xlint/lint1/gcc_init_compound_literal.c | 4 +- tests/usr.bin/xlint/lint1/gcc_typeof.c | 4 +- tests/usr.bin/xlint/lint1/init.c | 4 +- tests/usr.bin/xlint/lint1/init_c90.c | 4 +- tests/usr.bin/xlint/lint1/lex_char.c | 4 +- tests/usr.bin/xlint/lint1/lex_char_uchar.c | 3 +- tests/usr.bin/xlint/lint1/lex_floating.c | 4 +- tests/usr.bin/xlint/lint1/lex_integer.c | 3 +- .../usr.bin/xlint/lint1/lex_integer_binary.c | 4 +- tests/usr.bin/xlint/lint1/lex_integer_ilp32.c | 3 +- tests/usr.bin/xlint/lint1/lex_string.c | 4 +- tests/usr.bin/xlint/lint1/lex_wide_char.c | 4 +- tests/usr.bin/xlint/lint1/lex_wide_string.c | 4 +- tests/usr.bin/xlint/lint1/msg_000.c | 4 +- tests/usr.bin/xlint/lint1/msg_001.c | 4 +- tests/usr.bin/xlint/lint1/msg_001_c90.c | 4 +- tests/usr.bin/xlint/lint1/msg_002.c | 4 +- tests/usr.bin/xlint/lint1/msg_004.c | 4 +- tests/usr.bin/xlint/lint1/msg_006.c | 4 +- tests/usr.bin/xlint/lint1/msg_007.c | 4 +- tests/usr.bin/xlint/lint1/msg_009.c | 4 +- tests/usr.bin/xlint/lint1/msg_010.c | 4 +- tests/usr.bin/xlint/lint1/msg_013.c | 4 +- tests/usr.bin/xlint/lint1/msg_014.c | 4 +- tests/usr.bin/xlint/lint1/msg_015.c | 4 +- tests/usr.bin/xlint/lint1/msg_016.c | 4 +- tests/usr.bin/xlint/lint1/msg_017.c | 4 +- tests/usr.bin/xlint/lint1/msg_018.c | 4 +- tests/usr.bin/xlint/lint1/msg_019.c | 4 +- tests/usr.bin/xlint/lint1/msg_020.c | 4 +- tests/usr.bin/xlint/lint1/msg_022.c | 4 +- tests/usr.bin/xlint/lint1/msg_024.c | 4 +- tests/usr.bin/xlint/lint1/msg_026.c | 4 +- tests/usr.bin/xlint/lint1/msg_027.c | 4 +- tests/usr.bin/xlint/lint1/msg_029.c | 4 +- tests/usr.bin/xlint/lint1/msg_031.c | 4 +- tests/usr.bin/xlint/lint1/msg_038.c | 4 +- tests/usr.bin/xlint/lint1/msg_040.c | 4 +- tests/usr.bin/xlint/lint1/msg_044.c | 4 +- tests/usr.bin/xlint/lint1/msg_046.c | 4 +- tests/usr.bin/xlint/lint1/msg_049.c | 4 +- tests/usr.bin/xlint/lint1/msg_051.c | 4 +- tests/usr.bin/xlint/lint1/msg_058.c | 4 +- tests/usr.bin/xlint/lint1/msg_060.c | 4 +- tests/usr.bin/xlint/lint1/msg_061.c | 4 +- tests/usr.bin/xlint/lint1/msg_067.c | 4 +- tests/usr.bin/xlint/lint1/msg_068.c | 4 +- tests/usr.bin/xlint/lint1/msg_069.c | 4 +- tests/usr.bin/xlint/lint1/msg_070.c | 4 +- tests/usr.bin/xlint/lint1/msg_071.c | 4 +- tests/usr.bin/xlint/lint1/msg_073.c | 4 +- tests/usr.bin/xlint/lint1/msg_074.c | 4 +- tests/usr.bin/xlint/lint1/msg_075.c | 4 +- tests/usr.bin/xlint/lint1/msg_076.c | 4 +- tests/usr.bin/xlint/lint1/msg_077.c | 4 +- tests/usr.bin/xlint/lint1/msg_078.c | 4 +- tests/usr.bin/xlint/lint1/msg_079.c | 4 +- tests/usr.bin/xlint/lint1/msg_080.c | 4 +- tests/usr.bin/xlint/lint1/msg_081.c | 4 +- tests/usr.bin/xlint/lint1/msg_082.c | 4 +- tests/usr.bin/xlint/lint1/msg_083.c | 4 +- tests/usr.bin/xlint/lint1/msg_085.c | 4 +- tests/usr.bin/xlint/lint1/msg_086.c | 4 +- tests/usr.bin/xlint/lint1/msg_087.c | 4 +- tests/usr.bin/xlint/lint1/msg_088.c | 4 +- tests/usr.bin/xlint/lint1/msg_090.c | 4 +- tests/usr.bin/xlint/lint1/msg_095.c | 4 +- tests/usr.bin/xlint/lint1/msg_101.c | 4 +- tests/usr.bin/xlint/lint1/msg_112.c | 4 +- tests/usr.bin/xlint/lint1/msg_115.c | 4 +- tests/usr.bin/xlint/lint1/msg_123.c | 4 +- tests/usr.bin/xlint/lint1/msg_124.c | 4 +- tests/usr.bin/xlint/lint1/msg_129.c | 4 +- tests/usr.bin/xlint/lint1/msg_130.c | 4 +- tests/usr.bin/xlint/lint1/msg_131.c | 4 +- tests/usr.bin/xlint/lint1/msg_132.c | 4 +- tests/usr.bin/xlint/lint1/msg_132_ilp32.c | 4 +- tests/usr.bin/xlint/lint1/msg_135.c | 4 +- tests/usr.bin/xlint/lint1/msg_139.c | 4 +- tests/usr.bin/xlint/lint1/msg_141.c | 4 +- tests/usr.bin/xlint/lint1/msg_142.c | 4 +- tests/usr.bin/xlint/lint1/msg_147.c | 4 +- tests/usr.bin/xlint/lint1/msg_150.c | 4 +- tests/usr.bin/xlint/lint1/msg_151.c | 4 +- tests/usr.bin/xlint/lint1/msg_152.c | 4 +- tests/usr.bin/xlint/lint1/msg_153.c | 4 +- tests/usr.bin/xlint/lint1/msg_154.c | 4 +- tests/usr.bin/xlint/lint1/msg_155.c | 4 +- tests/usr.bin/xlint/lint1/msg_156.c | 4 +- tests/usr.bin/xlint/lint1/msg_157.c | 4 +- tests/usr.bin/xlint/lint1/msg_158.c | 4 +- tests/usr.bin/xlint/lint1/msg_160.c | 4 +- tests/usr.bin/xlint/lint1/msg_161.c | 4 +- tests/usr.bin/xlint/lint1/msg_162.c | 4 +- tests/usr.bin/xlint/lint1/msg_168.c | 4 +- tests/usr.bin/xlint/lint1/msg_169.c | 4 +- tests/usr.bin/xlint/lint1/msg_172.c | 4 +- tests/usr.bin/xlint/lint1/msg_173.c | 4 +- tests/usr.bin/xlint/lint1/msg_175.c | 4 +- tests/usr.bin/xlint/lint1/msg_176.c | 4 +- tests/usr.bin/xlint/lint1/msg_177.c | 4 +- tests/usr.bin/xlint/lint1/msg_178.c | 4 +- tests/usr.bin/xlint/lint1/msg_179.c | 4 +- tests/usr.bin/xlint/lint1/msg_180.c | 4 +- tests/usr.bin/xlint/lint1/msg_181.c | 4 +- tests/usr.bin/xlint/lint1/msg_185.c | 4 +- tests/usr.bin/xlint/lint1/msg_186.c | 4 +- tests/usr.bin/xlint/lint1/msg_187.c | 4 +- tests/usr.bin/xlint/lint1/msg_188.c | 4 +- tests/usr.bin/xlint/lint1/msg_190.c | 4 +- tests/usr.bin/xlint/lint1/msg_193.c | 4 +- tests/usr.bin/xlint/lint1/msg_204.c | 6 +-- tests/usr.bin/xlint/lint1/msg_210.c | 4 +- tests/usr.bin/xlint/lint1/msg_212.c | 4 +- tests/usr.bin/xlint/lint1/msg_218.c | 3 +- tests/usr.bin/xlint/lint1/msg_219.c | 4 +- tests/usr.bin/xlint/lint1/msg_220.c | 4 +- tests/usr.bin/xlint/lint1/msg_221.c | 4 +- tests/usr.bin/xlint/lint1/msg_222.c | 4 +- tests/usr.bin/xlint/lint1/msg_238.c | 4 +- tests/usr.bin/xlint/lint1/msg_241.c | 4 +- tests/usr.bin/xlint/lint1/msg_242.c | 4 +- tests/usr.bin/xlint/lint1/msg_243.c | 4 +- tests/usr.bin/xlint/lint1/msg_245.c | 4 +- tests/usr.bin/xlint/lint1/msg_247.c | 4 +- tests/usr.bin/xlint/lint1/msg_248.c | 4 +- tests/usr.bin/xlint/lint1/msg_249.c | 4 +- tests/usr.bin/xlint/lint1/msg_251.c | 4 +- tests/usr.bin/xlint/lint1/msg_252.c | 4 +- tests/usr.bin/xlint/lint1/msg_255.c | 4 +- tests/usr.bin/xlint/lint1/msg_256.c | 4 +- tests/usr.bin/xlint/lint1/msg_257.c | 4 +- tests/usr.bin/xlint/lint1/msg_258.c | 4 +- tests/usr.bin/xlint/lint1/msg_259.c | 4 +- tests/usr.bin/xlint/lint1/msg_259_c90.c | 4 +- tests/usr.bin/xlint/lint1/msg_259_ilp32.c | 4 +- tests/usr.bin/xlint/lint1/msg_262.c | 4 +- tests/usr.bin/xlint/lint1/msg_263.c | 4 +- tests/usr.bin/xlint/lint1/msg_264.c | 4 +- tests/usr.bin/xlint/lint1/msg_265.c | 4 +- tests/usr.bin/xlint/lint1/msg_266.c | 4 +- tests/usr.bin/xlint/lint1/msg_269.c | 4 +- tests/usr.bin/xlint/lint1/msg_270.c | 4 +- tests/usr.bin/xlint/lint1/msg_276.c | 4 +- tests/usr.bin/xlint/lint1/msg_277.c | 4 +- tests/usr.bin/xlint/lint1/msg_278.c | 4 +- tests/usr.bin/xlint/lint1/msg_279.c | 4 +- tests/usr.bin/xlint/lint1/msg_282.c | 4 +- tests/usr.bin/xlint/lint1/msg_284.c | 4 +- tests/usr.bin/xlint/lint1/msg_285.c | 4 +- tests/usr.bin/xlint/lint1/msg_291.c | 4 +- tests/usr.bin/xlint/lint1/msg_292.c | 4 +- tests/usr.bin/xlint/lint1/msg_294.c | 4 +- tests/usr.bin/xlint/lint1/msg_296.c | 4 +- tests/usr.bin/xlint/lint1/msg_297.c | 4 +- tests/usr.bin/xlint/lint1/msg_298.c | 4 +- tests/usr.bin/xlint/lint1/msg_301.c | 4 +- tests/usr.bin/xlint/lint1/msg_303.c | 4 +- tests/usr.bin/xlint/lint1/msg_304.c | 4 +- tests/usr.bin/xlint/lint1/msg_305.c | 4 +- tests/usr.bin/xlint/lint1/msg_308.c | 4 +- tests/usr.bin/xlint/lint1/msg_313.c | 4 +- tests/usr.bin/xlint/lint1/msg_315.c | 4 +- tests/usr.bin/xlint/lint1/msg_316.c | 4 +- tests/usr.bin/xlint/lint1/msg_319.c | 4 +- tests/usr.bin/xlint/lint1/msg_321.c | 4 +- tests/usr.bin/xlint/lint1/msg_323.c | 4 +- tests/usr.bin/xlint/lint1/msg_325.c | 4 +- tests/usr.bin/xlint/lint1/msg_326.c | 4 +- tests/usr.bin/xlint/lint1/msg_327.c | 4 +- tests/usr.bin/xlint/lint1/msg_330.c | 4 +- tests/usr.bin/xlint/lint1/msg_331.c | 4 +- tests/usr.bin/xlint/lint1/msg_332.c | 4 +- tests/usr.bin/xlint/lint1/msg_334.c | 4 +- tests/usr.bin/xlint/lint1/msg_336.c | 4 +- tests/usr.bin/xlint/lint1/msg_337.c | 4 +- tests/usr.bin/xlint/lint1/msg_338.c | 4 +- tests/usr.bin/xlint/lint1/msg_339.c | 4 +- tests/usr.bin/xlint/lint1/msg_341.c | 4 +- tests/usr.bin/xlint/lint1/msg_342.c | 4 +- tests/usr.bin/xlint/lint1/msg_343.c | 4 +- tests/usr.bin/xlint/lint1/msg_346.c | 4 +- tests/usr.bin/xlint/lint1/msg_347.c | 4 +- tests/usr.bin/xlint/lint1/msg_348.c | 4 +- tests/usr.bin/xlint/lint1/msg_349.c | 4 +- tests/usr.bin/xlint/lint1/msg_351.c | 37 ++++++++++++++++++ tests/usr.bin/xlint/lint1/op_colon.c | 4 +- tests/usr.bin/xlint/lint1/op_shl_lp64.c | 3 +- .../xlint/lint1/parse_init_declarator.c | 4 +- tests/usr.bin/xlint/lint1/parse_stmt_error.c | 4 +- .../xlint/lint1/parse_stmt_iter_error.c | 4 +- tests/usr.bin/xlint/lint1/parse_type_name.c | 4 +- .../usr.bin/xlint/lint1/platform_ilp32_int.c | 4 +- .../usr.bin/xlint/lint1/platform_ilp32_long.c | 4 +- tests/usr.bin/xlint/lint1/platform_int.c | 4 +- tests/usr.bin/xlint/lint1/platform_long.c | 4 +- tests/usr.bin/xlint/lint1/platform_lp64.c | 4 +- tests/usr.bin/xlint/lint1/queries.c | 4 +- tests/usr.bin/xlint/lint1/stmt_if.c | 4 +- usr.bin/xlint/lint1/Makefile | 9 +++-- usr.bin/xlint/lint1/decl.c | 38 ++++++++++++++----- usr.bin/xlint/lint1/err.c | 5 ++- usr.bin/xlint/lint1/externs1.h | 8 +++- usr.bin/xlint/lint1/func.c | 6 +-- usr.bin/xlint/lint1/tree.c | 7 +--- usr.bin/xlint/lint2/main2.c | 6 +-- 267 files changed, 764 insertions(+), 378 deletions(-) create mode 100644 tests/usr.bin/xlint/lint1/msg_351.c diff --git a/distrib/sets/lists/tests/mi b/distrib/sets/lists/tests/mi index 0459301568de..c575bed89f79 100644 --- a/distrib/sets/lists/tests/mi +++ b/distrib/sets/lists/tests/mi @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.1254 2023/02/27 23:07:53 rillig Exp $ +# $NetBSD: mi,v 1.1255 2023/03/28 14:44:34 rillig Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. # @@ -7341,6 +7341,7 @@ ./usr/tests/usr.bin/xlint/lint1/msg_349.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/msg_349.exp tests-obsolete obsolete,atf ./usr/tests/usr.bin/xlint/lint1/msg_350.c tests-usr.bin-tests compattestfile,atf +./usr/tests/usr.bin/xlint/lint1/msg_351.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/op_colon.c tests-usr.bin-tests compattestfile,atf ./usr/tests/usr.bin/xlint/lint1/op_colon.exp tests-obsolete obsolete,atf ./usr/tests/usr.bin/xlint/lint1/op_shl_lp64.c tests-usr.bin-tests compattestfile,atf diff --git a/lib/libppath/Makefile b/lib/libppath/Makefile index c41628f7c782..0973ba8e4539 100644 --- a/lib/libppath/Makefile +++ b/lib/libppath/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2013/09/11 23:04:11 joerg Exp $ +# $NetBSD: Makefile,v 1.4 2023/03/28 14:44:34 rillig Exp $ .include @@ -17,6 +17,7 @@ SRCS+=ppath_malloc.c LIBDPLIBS+= prop ${NETBSDSRCDIR}/lib/libprop LINTFLAGS+=-w +LINTFLAGS.ppath_extant.c+= -X 351 # 'extern' declaration outside header LIB= ppath MAN+= ppath.3 diff --git a/lib/libpuffs/Makefile b/lib/libpuffs/Makefile index c9dce1322a87..6ce73867c4de 100644 --- a/lib/libpuffs/Makefile +++ b/lib/libpuffs/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.27 2022/01/22 07:35:26 pho Exp $ +# $NetBSD: Makefile,v 1.28 2023/03/28 14:44:34 rillig Exp $ # .include @@ -17,5 +17,6 @@ MAN= puffs.3 puffs_cc.3 puffs_cred.3 puffs_flush.3 \ INCS= puffs.h puffsdump.h INCSDIR= /usr/include LINTFLAGS+=-S -w +LINTFLAGS+= -X 351 # extern declaration outside header .include diff --git a/lib/libutil/Makefile b/lib/libutil/Makefile index 1c2aad0f4823..1860e5cd8838 100644 --- a/lib/libutil/Makefile +++ b/lib/libutil/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.85 2019/10/13 07:28:11 mrg Exp $ +# $NetBSD: Makefile,v 1.86 2023/03/28 14:44:34 rillig Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 USE_SHLIBDIR= yes @@ -38,6 +38,7 @@ MAN= efun.3 \ CPPFLAGS.sockaddr_snprintf.c+=-DHAVE_UTIL_H CPPFLAGS.sockaddr_snprintf.c+=-DHAVE_NETATALK_AT_H CPPFLAGS.sockaddr_snprintf.c+=-DHAVE_NET_IF_DL_H +LINTFLAGS.if_media.c+= -X 351 # 'extern' declaration outside header COPTS.logwtmp.c+= ${GCC_NO_STRINGOP_TRUNCATION} COPTS.logwtmpx.c+= ${GCC_NO_STRINGOP_TRUNCATION} diff --git a/tests/usr.bin/xlint/lint1/c11_generic_expression.c b/tests/usr.bin/xlint/lint1/c11_generic_expression.c index b7ceae3a6b0d..9bf28dd4bc19 100644 --- a/tests/usr.bin/xlint/lint1/c11_generic_expression.c +++ b/tests/usr.bin/xlint/lint1/c11_generic_expression.c @@ -1,4 +1,4 @@ -/* $NetBSD: c11_generic_expression.c,v 1.14 2023/01/04 05:32:01 rillig Exp $ */ +/* $NetBSD: c11_generic_expression.c,v 1.15 2023/03/28 14:44:34 rillig Exp $ */ # 3 "c11_generic_expression.c" /* @@ -11,7 +11,7 @@ * C11 6.5.1.1 "Generic selection" */ -/* lint1-extra-flags: -Ac11 */ +/* lint1-extra-flags: -Ac11 -X 351 */ /* * The type of 'var' is not compatible with any of the types from the diff --git a/tests/usr.bin/xlint/lint1/c90.c b/tests/usr.bin/xlint/lint1/c90.c index 01030676bf63..3304cec2c1d1 100644 --- a/tests/usr.bin/xlint/lint1/c90.c +++ b/tests/usr.bin/xlint/lint1/c90.c @@ -1,4 +1,4 @@ -/* $NetBSD: c90.c,v 1.1 2021/07/25 22:03:42 rillig Exp $ */ +/* $NetBSD: c90.c,v 1.2 2023/03/28 14:44:34 rillig Exp $ */ # 3 "c90.c" /* @@ -6,7 +6,7 @@ * later C standards nor GNU extensions. */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ /* expect+1: error: ANSI C requires formal parameter before '...' [84] */ void varargs_function(...); diff --git a/tests/usr.bin/xlint/lint1/d_c99_anon_union.c b/tests/usr.bin/xlint/lint1/d_c99_anon_union.c index 0ef481d545fd..3308d8f12825 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_anon_union.c +++ b/tests/usr.bin/xlint/lint1/d_c99_anon_union.c @@ -1,8 +1,10 @@ -/* $NetBSD: d_c99_anon_union.c,v 1.4 2021/02/20 22:31:20 rillig Exp $ */ +/* $NetBSD: d_c99_anon_union.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_anon_union.c" /* struct with only anonymous members */ +/* lint1-extra-flags: -X 351 */ + struct foo { union { long loo; diff --git a/tests/usr.bin/xlint/lint1/d_c99_bool.c b/tests/usr.bin/xlint/lint1/d_c99_bool.c index 22b34174ac3b..1d5d7cc56d95 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_bool.c +++ b/tests/usr.bin/xlint/lint1/d_c99_bool.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool.c,v 1.9 2022/01/16 08:40:31 rillig Exp $ */ +/* $NetBSD: d_c99_bool.c,v 1.10 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_bool.c" /* @@ -9,6 +9,8 @@ * invoke undefined behavior. */ +/* lint1-extra-flags: -X 351 */ + /* Below, each false statement produces "negative array dimension" [20]. */ int int_0_converts_to_false[(_Bool)0 ? -1 : 1]; diff --git a/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c b/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c index 6789c7e80588..ea6ea4389eb7 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c +++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool_strict.c,v 1.39 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict.c,v 1.40 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_bool_strict.c" /* @@ -98,7 +98,7 @@ * __lint_false and true to __lint_true, two predefined constant expressions. */ -/* lint1-extra-flags: -hT */ +/* lint1-extra-flags: -hT -X 351 */ /* * strict-bool-typedef diff --git a/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c b/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c index 07209169b5ad..f4b566976f91 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c +++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_bool_strict_syshdr.c,v 1.18 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: d_c99_bool_strict_syshdr.c,v 1.19 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_bool_strict_syshdr.c" /* @@ -11,7 +11,7 @@ * and functions from system headers may use int expressions as well. */ -/* lint1-extra-flags: -T */ +/* lint1-extra-flags: -T -X 351 */ extern const unsigned short *ctype_table; diff --git a/tests/usr.bin/xlint/lint1/d_c99_complex_num.c b/tests/usr.bin/xlint/lint1/d_c99_complex_num.c index 060cd7079284..382a1b641a74 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_complex_num.c +++ b/tests/usr.bin/xlint/lint1/d_c99_complex_num.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_complex_num.c,v 1.2 2021/01/31 14:39:31 rillig Exp $ */ +/* $NetBSD: d_c99_complex_num.c,v 1.3 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_complex_num.c" +/* lint1-extra-flags: -X 351 */ + double cabs(double _Complex); double cabs(double _Complex foo) diff --git a/tests/usr.bin/xlint/lint1/d_c99_complex_split.c b/tests/usr.bin/xlint/lint1/d_c99_complex_split.c index 3dd357881472..1aef60fd056c 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_complex_split.c +++ b/tests/usr.bin/xlint/lint1/d_c99_complex_split.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_complex_split.c,v 1.12 2023/02/05 10:57:48 rillig Exp $ */ +/* $NetBSD: d_c99_complex_split.c,v 1.13 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_complex_split.c" /* @@ -6,6 +6,8 @@ * accessed (since C99). */ +/* lint1-extra-flags: -X 351 */ + int b(double a) { diff --git a/tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c b/tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c index 889a32eaabf1..b63a54dc6f64 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c +++ b/tests/usr.bin/xlint/lint1/d_c99_flex_array_packed.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_flex_array_packed.c,v 1.2 2021/01/31 14:39:31 rillig Exp $ */ +/* $NetBSD: d_c99_flex_array_packed.c,v 1.3 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_flex_array_packed.c" +/* lint1-extra-flags: -X 351 */ + /* Allow packed c99 flexible arrays */ struct { int x; diff --git a/tests/usr.bin/xlint/lint1/d_c99_for_loops.c b/tests/usr.bin/xlint/lint1/d_c99_for_loops.c index 929a31482fd3..01002afe52be 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_for_loops.c +++ b/tests/usr.bin/xlint/lint1/d_c99_for_loops.c @@ -1,7 +1,8 @@ -/* $NetBSD: d_c99_for_loops.c,v 1.3 2021/01/31 14:39:31 rillig Exp $ */ +/* $NetBSD: d_c99_for_loops.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_for_loops.c" -/* c99 for loops */ +/* lint1-extra-flags: -X 351 */ + extern void foo(int); int diff --git a/tests/usr.bin/xlint/lint1/d_c99_func.c b/tests/usr.bin/xlint/lint1/d_c99_func.c index 53756faa0afe..402d6e91d49d 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_func.c +++ b/tests/usr.bin/xlint/lint1/d_c99_func.c @@ -1,8 +1,10 @@ -/* $NetBSD: d_c99_func.c,v 1.5 2023/01/29 18:16:48 rillig Exp $ */ +/* $NetBSD: d_c99_func.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_func.c" /* C99 __func__ */ +/* lint1-extra-flags: -X 351 */ + const char *str; const char * diff --git a/tests/usr.bin/xlint/lint1/d_c99_init.c b/tests/usr.bin/xlint/lint1/d_c99_init.c index 7116238da61b..34a27bea554f 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_init.c +++ b/tests/usr.bin/xlint/lint1/d_c99_init.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_init.c,v 1.44 2023/02/05 13:01:28 rillig Exp $ */ +/* $NetBSD: d_c99_init.c,v 1.45 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_init.c" /* @@ -7,6 +7,8 @@ * See C99 6.7.8 "Initialization". */ +/* lint1-extra-flags: -X 351 */ + void use(const void *); diff --git a/tests/usr.bin/xlint/lint1/d_c99_nested_struct.c b/tests/usr.bin/xlint/lint1/d_c99_nested_struct.c index 59822a87b0c6..b24727874d7f 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_nested_struct.c +++ b/tests/usr.bin/xlint/lint1/d_c99_nested_struct.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_nested_struct.c,v 1.4 2021/02/20 22:31:20 rillig Exp $ */ +/* $NetBSD: d_c99_nested_struct.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_nested_struct.c" +/* lint1-extra-flags: -X 351 */ + /* C99 nested struct init with named and non-named initializers */ typedef struct pthread_mutex_t { unsigned int ptm_magic; diff --git a/tests/usr.bin/xlint/lint1/d_c99_struct_init.c b/tests/usr.bin/xlint/lint1/d_c99_struct_init.c index 86e58e52d4f8..0ab1c28860d5 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_struct_init.c +++ b/tests/usr.bin/xlint/lint1/d_c99_struct_init.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_struct_init.c,v 1.4 2021/02/20 22:31:20 rillig Exp $ */ +/* $NetBSD: d_c99_struct_init.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_struct_init.c" +/* lint1-extra-flags: -X 351 */ + /* C99 struct initialization */ struct { int i; diff --git a/tests/usr.bin/xlint/lint1/d_c99_union_init1.c b/tests/usr.bin/xlint/lint1/d_c99_union_init1.c index b60de5f660f2..5ec7820f31a7 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_union_init1.c +++ b/tests/usr.bin/xlint/lint1/d_c99_union_init1.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_union_init1.c,v 1.4 2021/02/20 22:31:20 rillig Exp $ */ +/* $NetBSD: d_c99_union_init1.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_union_init1.c" +/* lint1-extra-flags: -X 351 */ + /* GCC-style and C99-style union initialization */ union { int i; diff --git a/tests/usr.bin/xlint/lint1/d_c99_union_init2.c b/tests/usr.bin/xlint/lint1/d_c99_union_init2.c index a981aa2f1f6a..b4085a1b01ea 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_union_init2.c +++ b/tests/usr.bin/xlint/lint1/d_c99_union_init2.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_union_init2.c,v 1.3 2021/01/31 14:39:31 rillig Exp $ */ +/* $NetBSD: d_c99_union_init2.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_union_init2.c" +/* lint1-extra-flags: -X 351 */ + /* C99 union initialization */ union { int i[10]; diff --git a/tests/usr.bin/xlint/lint1/d_c99_union_init3.c b/tests/usr.bin/xlint/lint1/d_c99_union_init3.c index 7f032b0cdeae..7b62e6db00e1 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_union_init3.c +++ b/tests/usr.bin/xlint/lint1/d_c99_union_init3.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_union_init3.c,v 1.5 2021/02/20 22:31:20 rillig Exp $ */ +/* $NetBSD: d_c99_union_init3.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_union_init3.c" +/* lint1-extra-flags: -X 351 */ + /* C99 struct initialization */ struct { int i[10]; diff --git a/tests/usr.bin/xlint/lint1/d_c99_union_init4.c b/tests/usr.bin/xlint/lint1/d_c99_union_init4.c index 1a8de085c3bc..59f99c14fe89 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_union_init4.c +++ b/tests/usr.bin/xlint/lint1/d_c99_union_init4.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c99_union_init4.c,v 1.3 2021/01/31 14:39:31 rillig Exp $ */ +/* $NetBSD: d_c99_union_init4.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_union_init4.c" +/* lint1-extra-flags: -X 351 */ + /* test .data.l[x] */ typedef struct { int type; diff --git a/tests/usr.bin/xlint/lint1/d_c99_union_init5.c b/tests/usr.bin/xlint/lint1/d_c99_union_init5.c index 677d4f9a15de..2923840dd201 100644 --- a/tests/usr.bin/xlint/lint1/d_c99_union_init5.c +++ b/tests/usr.bin/xlint/lint1/d_c99_union_init5.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_c99_union_init5.c,v 1.1 2021/02/28 20:17:14 rillig Exp $ */ +/* $NetBSD: d_c99_union_init5.c,v 1.2 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c99_union_init5.c" /* @@ -8,6 +8,8 @@ * 2006.12.19.19.06.44. */ +/* lint1-extra-flags: -X 351 */ + union mist { char *p; int a[1]; diff --git a/tests/usr.bin/xlint/lint1/d_c9x_array_init.c b/tests/usr.bin/xlint/lint1/d_c9x_array_init.c index 3feaa3decdf7..c0604de9e21f 100644 --- a/tests/usr.bin/xlint/lint1/d_c9x_array_init.c +++ b/tests/usr.bin/xlint/lint1/d_c9x_array_init.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_c9x_array_init.c,v 1.3 2021/02/20 22:31:20 rillig Exp $ */ +/* $NetBSD: d_c9x_array_init.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_c9x_array_init.c" +/* lint1-extra-flags: -X 351 */ + /* GCC-specific array range initializers */ int foo[256] = { [2] = 1, diff --git a/tests/usr.bin/xlint/lint1/d_cast_lhs.c b/tests/usr.bin/xlint/lint1/d_cast_lhs.c index b88e91445cdf..1acf62fe69b9 100644 --- a/tests/usr.bin/xlint/lint1/d_cast_lhs.c +++ b/tests/usr.bin/xlint/lint1/d_cast_lhs.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_cast_lhs.c,v 1.5 2021/07/04 13:14:54 rillig Exp $ */ +/* $NetBSD: d_cast_lhs.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_cast_lhs.c" /* @@ -9,6 +9,9 @@ * C99 6.5.4 "Cast operators" footnote 85 says "A cast does not yield an * lvalue". */ + +/* lint1-extra-flags: -X 351 */ + struct str { int member; }; diff --git a/tests/usr.bin/xlint/lint1/d_cast_typeof.c b/tests/usr.bin/xlint/lint1/d_cast_typeof.c index e1f653058c91..9a0a2b4dc0f8 100644 --- a/tests/usr.bin/xlint/lint1/d_cast_typeof.c +++ b/tests/usr.bin/xlint/lint1/d_cast_typeof.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_cast_typeof.c,v 1.3 2021/01/31 14:39:31 rillig Exp $ */ +/* $NetBSD: d_cast_typeof.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_cast_typeof.c" +/* lint1-extra-flags: -X 351 */ + struct foo { char list; }; diff --git a/tests/usr.bin/xlint/lint1/d_compound_literals2.c b/tests/usr.bin/xlint/lint1/d_compound_literals2.c index e63facb68a3b..2e11f4cb48b9 100644 --- a/tests/usr.bin/xlint/lint1/d_compound_literals2.c +++ b/tests/usr.bin/xlint/lint1/d_compound_literals2.c @@ -1,8 +1,10 @@ -/* $NetBSD: d_compound_literals2.c,v 1.4 2022/04/24 20:08:23 rillig Exp $ */ +/* $NetBSD: d_compound_literals2.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_compound_literals2.c" /* compound literals */ +/* lint1-extra-flags: -X 351 */ + struct p { short a, b, c, d; } zz = { diff --git a/tests/usr.bin/xlint/lint1/d_constant_conv1.c b/tests/usr.bin/xlint/lint1/d_constant_conv1.c index d2f8d575a2e7..114765720e40 100644 --- a/tests/usr.bin/xlint/lint1/d_constant_conv1.c +++ b/tests/usr.bin/xlint/lint1/d_constant_conv1.c @@ -1,8 +1,10 @@ -/* $NetBSD: d_constant_conv1.c,v 1.4 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: d_constant_conv1.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_constant_conv1.c" /* Flag information-losing constant conversion in argument lists */ +/* lint1-extra-flags: -X 351 */ + int f(unsigned int); void diff --git a/tests/usr.bin/xlint/lint1/d_constant_conv2.c b/tests/usr.bin/xlint/lint1/d_constant_conv2.c index 39dc1ded4ef1..8accf8b5ac20 100644 --- a/tests/usr.bin/xlint/lint1/d_constant_conv2.c +++ b/tests/usr.bin/xlint/lint1/d_constant_conv2.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_constant_conv2.c,v 1.5 2022/04/15 21:50:07 rillig Exp $ */ +/* $NetBSD: d_constant_conv2.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_constant_conv2.c" /* Flag information-losing constant conversion in argument lists */ @@ -9,6 +9,7 @@ * non-prototype functions an issue. */ /* lint1-flags: -h -w */ +/* lint1-extra-flags: -X 351 */ int f(unsigned int); diff --git a/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c b/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c index edf6c2eade11..d4839b1ffee0 100644 --- a/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c +++ b/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c @@ -5,6 +5,8 @@ * that is completely different. */ +/* lint1-extra-flags: -X 351 */ + void func(int a, int b, int c); /* expect+4: warning: argument 'num' unused in function 'func' [231] */ diff --git a/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c b/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c index 5af3abe56a7b..451f8446da3b 100644 --- a/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c +++ b/tests/usr.bin/xlint/lint1/d_gcc_compound_statements1.c @@ -1,8 +1,10 @@ -/* $NetBSD: d_gcc_compound_statements1.c,v 1.11 2022/06/15 18:11:02 rillig Exp $ */ +/* $NetBSD: d_gcc_compound_statements1.c,v 1.12 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_gcc_compound_statements1.c" /* GCC compound statement with expression */ +/* lint1-extra-flags: -X 351 */ + /* * Compound statements are only allowed in functions, not at file scope. * diff --git a/tests/usr.bin/xlint/lint1/d_gcc_extension.c b/tests/usr.bin/xlint/lint1/d_gcc_extension.c index 7fcf0d1ae8fe..8c05fd93f1ab 100644 --- a/tests/usr.bin/xlint/lint1/d_gcc_extension.c +++ b/tests/usr.bin/xlint/lint1/d_gcc_extension.c @@ -1,10 +1,12 @@ -/* $NetBSD: d_gcc_extension.c,v 1.6 2021/05/25 19:22:18 rillig Exp $ */ +/* $NetBSD: d_gcc_extension.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_gcc_extension.c" /* * Test that the GCC '__extension__' and '__typeof' are recognized. */ +/* lint1-extra-flags: -X 351 */ + _Bool dbl_isinf(double); /* extension */ diff --git a/tests/usr.bin/xlint/lint1/d_init_array_using_string.c b/tests/usr.bin/xlint/lint1/d_init_array_using_string.c index 1da0974ae416..ea288f701d6d 100644 --- a/tests/usr.bin/xlint/lint1/d_init_array_using_string.c +++ b/tests/usr.bin/xlint/lint1/d_init_array_using_string.c @@ -1,10 +1,12 @@ -/* $NetBSD: d_init_array_using_string.c,v 1.12 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: d_init_array_using_string.c,v 1.13 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_init_array_using_string.c" /* * Test initialization of arrays and pointers by string literals. */ +/* lint1-extra-flags: -X 351 */ + void sink(const void *); void diff --git a/tests/usr.bin/xlint/lint1/d_lint_assert.c b/tests/usr.bin/xlint/lint1/d_lint_assert.c index bd94f369b498..2ed09f48bbed 100644 --- a/tests/usr.bin/xlint/lint1/d_lint_assert.c +++ b/tests/usr.bin/xlint/lint1/d_lint_assert.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_lint_assert.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ +/* $NetBSD: d_lint_assert.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_lint_assert.c" /* @@ -6,6 +6,8 @@ * just hard to trigger, but not impossible. */ +/* lint1-extra-flags: -X 351 */ + enum { // Before decl.c 1.118 from 2021-01-10: // lint: assertion "sym->s_scl == EXTERN || sym->s_scl == STATIC" diff --git a/tests/usr.bin/xlint/lint1/d_nested_structs.c b/tests/usr.bin/xlint/lint1/d_nested_structs.c index 16d98ffdb7b3..a68859689d9b 100644 --- a/tests/usr.bin/xlint/lint1/d_nested_structs.c +++ b/tests/usr.bin/xlint/lint1/d_nested_structs.c @@ -1,6 +1,8 @@ -/* $NetBSD: d_nested_structs.c,v 1.3 2021/01/31 14:57:28 rillig Exp $ */ +/* $NetBSD: d_nested_structs.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_nested_structs.c" +/* lint1-extra-flags: -X 351 */ + /* Nested struct */ typedef void *EditLine; typedef void *History; diff --git a/tests/usr.bin/xlint/lint1/d_packed_structs.c b/tests/usr.bin/xlint/lint1/d_packed_structs.c index ac1f13cbd2fa..5e1cf3789ccc 100644 --- a/tests/usr.bin/xlint/lint1/d_packed_structs.c +++ b/tests/usr.bin/xlint/lint1/d_packed_structs.c @@ -1,8 +1,10 @@ -/* $NetBSD: d_packed_structs.c,v 1.3 2021/01/31 14:57:28 rillig Exp $ */ +/* $NetBSD: d_packed_structs.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_packed_structs.c" /* packed tests */ +/* lint1-extra-flags: -X 351 */ + struct in_addr { int x; }; diff --git a/tests/usr.bin/xlint/lint1/d_struct_init_nested.c b/tests/usr.bin/xlint/lint1/d_struct_init_nested.c index 1a4e157f5fe5..482f265e2cb1 100644 --- a/tests/usr.bin/xlint/lint1/d_struct_init_nested.c +++ b/tests/usr.bin/xlint/lint1/d_struct_init_nested.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_struct_init_nested.c,v 1.7 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: d_struct_init_nested.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_struct_init_nested.c" /* @@ -8,6 +8,8 @@ * In C99, 6.7.8p13 describes exactly this case. */ +/* lint1-extra-flags: -X 351 */ + typedef enum O1 { O1C = 101 } O1; typedef enum O2 { O2C = 102 } O2; typedef enum O3 { O3C = 103 } O3; diff --git a/tests/usr.bin/xlint/lint1/d_type_conv1.c b/tests/usr.bin/xlint/lint1/d_type_conv1.c index 65a768534e7f..020f45c3d831 100644 --- a/tests/usr.bin/xlint/lint1/d_type_conv1.c +++ b/tests/usr.bin/xlint/lint1/d_type_conv1.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_type_conv1.c,v 1.5 2022/04/15 21:50:07 rillig Exp $ */ +/* $NetBSD: d_type_conv1.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_type_conv1.c" /* Flag information-losing type conversion in argument lists */ @@ -9,6 +9,7 @@ * non-prototype functions an issue. */ /* lint1-flags: -g -h -w */ +/* lint1-extra-flags: -X 351 */ int f(unsigned int); diff --git a/tests/usr.bin/xlint/lint1/d_type_conv2.c b/tests/usr.bin/xlint/lint1/d_type_conv2.c index 4896f233f31b..cf0a76aa70f9 100644 --- a/tests/usr.bin/xlint/lint1/d_type_conv2.c +++ b/tests/usr.bin/xlint/lint1/d_type_conv2.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_type_conv2.c,v 1.5 2022/04/15 21:50:07 rillig Exp $ */ +/* $NetBSD: d_type_conv2.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_type_conv2.c" /* Flag information-losing type conversion in argument lists */ @@ -9,6 +9,7 @@ * non-prototype functions an issue. */ /* lint1-flags: -h -w */ +/* lint1-extra-flags: -X 351 */ int f(float); diff --git a/tests/usr.bin/xlint/lint1/d_type_conv3.c b/tests/usr.bin/xlint/lint1/d_type_conv3.c index 22a499d0e4c0..251ed1f0a44b 100644 --- a/tests/usr.bin/xlint/lint1/d_type_conv3.c +++ b/tests/usr.bin/xlint/lint1/d_type_conv3.c @@ -1,4 +1,4 @@ -/* $NetBSD: d_type_conv3.c,v 1.6 2022/04/15 21:50:07 rillig Exp $ */ +/* $NetBSD: d_type_conv3.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_type_conv3.c" /* Flag information-losing type conversion in argument lists */ @@ -9,6 +9,7 @@ * non-prototype functions an issue. */ /* lint1-flags: -g -h -w */ +/* lint1-extra-flags: -X 351 */ int f(unsigned int); diff --git a/tests/usr.bin/xlint/lint1/d_typefun.c b/tests/usr.bin/xlint/lint1/d_typefun.c index c25278d711c0..519150d82a03 100644 --- a/tests/usr.bin/xlint/lint1/d_typefun.c +++ b/tests/usr.bin/xlint/lint1/d_typefun.c @@ -1,8 +1,10 @@ -/* $NetBSD: d_typefun.c,v 1.3 2021/01/31 14:39:31 rillig Exp $ */ +/* $NetBSD: d_typefun.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "d_typefun.c" /* typedef of function parameter */ +/* lint1-extra-flags: -X 351 */ + typedef void (*free_func)(void *opaque, void *address); typedef struct stack_st { diff --git a/tests/usr.bin/xlint/lint1/decl.c b/tests/usr.bin/xlint/lint1/decl.c index f7d30ead1094..4f8185f1a427 100644 --- a/tests/usr.bin/xlint/lint1/decl.c +++ b/tests/usr.bin/xlint/lint1/decl.c @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.20 2022/10/01 09:42:40 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.21 2023/03/28 14:44:34 rillig Exp $ */ # 3 "decl.c" /* @@ -6,6 +6,8 @@ * declaration-specifiers and the declarators. */ +/* lint1-extra-flags: -X 351 */ + /* * Even though 'const' comes after 'char' and is therefore quite close to the * first identifier, it applies to both identifiers. diff --git a/tests/usr.bin/xlint/lint1/decl_arg.c b/tests/usr.bin/xlint/lint1/decl_arg.c index b0e523d3fca0..6034e5bdfcd0 100644 --- a/tests/usr.bin/xlint/lint1/decl_arg.c +++ b/tests/usr.bin/xlint/lint1/decl_arg.c @@ -1,4 +1,4 @@ -/* $NetBSD: decl_arg.c,v 1.7 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: decl_arg.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "decl_arg.c" /* @@ -7,6 +7,8 @@ * See arg_declaration in cgram.y. */ +/* lint1-extra-flags: -X 351 */ + typedef double number; void no_args(void); diff --git a/tests/usr.bin/xlint/lint1/decl_direct_abstract.c b/tests/usr.bin/xlint/lint1/decl_direct_abstract.c index b74b9522cfae..365531365605 100644 --- a/tests/usr.bin/xlint/lint1/decl_direct_abstract.c +++ b/tests/usr.bin/xlint/lint1/decl_direct_abstract.c @@ -1,4 +1,4 @@ -/* $NetBSD: decl_direct_abstract.c,v 1.7 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: decl_direct_abstract.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "decl_direct_abstract.c" /* @@ -9,6 +9,8 @@ * See msg_155.c. */ +/* lint1-extra-flags: -X 351 */ + /* * The following tests do not use int, to avoid confusion with the implicit * return type. diff --git a/tests/usr.bin/xlint/lint1/decl_struct_member.c b/tests/usr.bin/xlint/lint1/decl_struct_member.c index f0ccc726a1eb..2b96a0edfc92 100644 --- a/tests/usr.bin/xlint/lint1/decl_struct_member.c +++ b/tests/usr.bin/xlint/lint1/decl_struct_member.c @@ -1,6 +1,8 @@ -/* $NetBSD: decl_struct_member.c,v 1.15 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: decl_struct_member.c,v 1.16 2023/03/28 14:44:34 rillig Exp $ */ # 3 "decl_struct_member.c" +/* lint1-extra-flags: -X 351 */ + struct multi_attributes { __attribute__((deprecated)) __attribute__((deprecated)) diff --git a/tests/usr.bin/xlint/lint1/emit.c b/tests/usr.bin/xlint/lint1/emit.c index 4e9abc9baf9e..bfa7ad8b2680 100644 --- a/tests/usr.bin/xlint/lint1/emit.c +++ b/tests/usr.bin/xlint/lint1/emit.c @@ -1,4 +1,4 @@ -/* $NetBSD: emit.c,v 1.14 2022/10/01 09:42:40 rillig Exp $ */ +/* $NetBSD: emit.c,v 1.15 2023/03/28 14:44:34 rillig Exp $ */ # 3 "emit.c" /* @@ -7,8 +7,8 @@ * consistently across different translation units. */ -/* Do not warn about unused parameters. */ -/* lint1-extra-flags: -X 231 */ +/* Do not warn about unused parameters or 'extern' declarations. */ +/* lint1-extra-flags: -X 231 -X 351 */ /* * Define some derived types. diff --git a/tests/usr.bin/xlint/lint1/emit_lp64.c b/tests/usr.bin/xlint/lint1/emit_lp64.c index 97b262f9b5e6..1e2634ede0df 100644 --- a/tests/usr.bin/xlint/lint1/emit_lp64.c +++ b/tests/usr.bin/xlint/lint1/emit_lp64.c @@ -1,4 +1,4 @@ -/* $NetBSD: emit_lp64.c,v 1.1 2021/08/05 06:34:43 rillig Exp $ */ +/* $NetBSD: emit_lp64.c,v 1.2 2023/03/28 14:44:34 rillig Exp $ */ # 3 "emit_lp64.c" /* @@ -11,7 +11,7 @@ */ // omit the option '-g' to avoid having the GCC builtins in the .ln file. -/* lint1-flags: -Sw */ +/* lint1-flags: -Sw -X 351 */ /* lint1-only-if: lp64 */ diff --git a/tests/usr.bin/xlint/lint1/expr_binary.c b/tests/usr.bin/xlint/lint1/expr_binary.c index b0baab4e49f0..a443b1f4e2c2 100644 --- a/tests/usr.bin/xlint/lint1/expr_binary.c +++ b/tests/usr.bin/xlint/lint1/expr_binary.c @@ -1,4 +1,4 @@ -/* $NetBSD: expr_binary.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: expr_binary.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_binary.c" /* @@ -6,6 +6,7 @@ */ /* lint1-only-if: lp64 */ +/* lint1-extra-flags: -X 351 */ struct incompatible { /* just to generate the error message */ int member; diff --git a/tests/usr.bin/xlint/lint1/expr_binary_trad.c b/tests/usr.bin/xlint/lint1/expr_binary_trad.c index a95873ad45ee..c0dda3b31d70 100644 --- a/tests/usr.bin/xlint/lint1/expr_binary_trad.c +++ b/tests/usr.bin/xlint/lint1/expr_binary_trad.c @@ -1,11 +1,11 @@ -/* $NetBSD: expr_binary_trad.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: expr_binary_trad.c,v 1.3 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_binary_trad.c" /* * Test binary operators in traditional C. */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ struct incompatible { /* just to generate the error message */ int member; diff --git a/tests/usr.bin/xlint/lint1/expr_fold.c b/tests/usr.bin/xlint/lint1/expr_fold.c index 07ac4bd9a1cc..0a503d130181 100644 --- a/tests/usr.bin/xlint/lint1/expr_fold.c +++ b/tests/usr.bin/xlint/lint1/expr_fold.c @@ -1,11 +1,11 @@ -/* $NetBSD: expr_fold.c,v 1.7 2022/04/19 23:16:14 rillig Exp $ */ +/* $NetBSD: expr_fold.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_fold.c" /* * Test folding of constant expressions. */ -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ /* * On ILP32 platforms, the integer constant 2147483648 cannot be represented diff --git a/tests/usr.bin/xlint/lint1/expr_precedence.c b/tests/usr.bin/xlint/lint1/expr_precedence.c index 10743d6dd36f..b264b92c0335 100644 --- a/tests/usr.bin/xlint/lint1/expr_precedence.c +++ b/tests/usr.bin/xlint/lint1/expr_precedence.c @@ -1,10 +1,12 @@ -/* $NetBSD: expr_precedence.c,v 1.10 2022/08/25 19:03:48 rillig Exp $ */ +/* $NetBSD: expr_precedence.c,v 1.11 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_precedence.c" /* * Tests for the precedence among operators. */ +/* lint1-extra-flags: -X 351 */ + int var; /* diff --git a/tests/usr.bin/xlint/lint1/expr_promote.c b/tests/usr.bin/xlint/lint1/expr_promote.c index 6fd336fdd76b..a7af50bf11ec 100644 --- a/tests/usr.bin/xlint/lint1/expr_promote.c +++ b/tests/usr.bin/xlint/lint1/expr_promote.c @@ -1,11 +1,11 @@ -/* $NetBSD: expr_promote.c,v 1.3 2023/01/04 05:47:19 rillig Exp $ */ +/* $NetBSD: expr_promote.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_promote.c" /* * Test arithmetic promotions in C90 and later. */ -/* lint1-flags: -Sw */ +/* lint1-flags: -Sw -X 351 */ void sink(const char *, ...); diff --git a/tests/usr.bin/xlint/lint1/expr_promote_trad.c b/tests/usr.bin/xlint/lint1/expr_promote_trad.c index 4fa5638f20de..4f5fc88f19ae 100644 --- a/tests/usr.bin/xlint/lint1/expr_promote_trad.c +++ b/tests/usr.bin/xlint/lint1/expr_promote_trad.c @@ -1,11 +1,11 @@ -/* $NetBSD: expr_promote_trad.c,v 1.3 2023/01/04 05:47:19 rillig Exp $ */ +/* $NetBSD: expr_promote_trad.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_promote_trad.c" /* * Test arithmetic promotions in traditional C. */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ sink(); diff --git a/tests/usr.bin/xlint/lint1/expr_range.c b/tests/usr.bin/xlint/lint1/expr_range.c index 9e4b9470bf5f..c2a204beb783 100644 --- a/tests/usr.bin/xlint/lint1/expr_range.c +++ b/tests/usr.bin/xlint/lint1/expr_range.c @@ -1,4 +1,4 @@ -/* $NetBSD: expr_range.c,v 1.4 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: expr_range.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_range.c" /* @@ -16,7 +16,7 @@ * possible values may be related to RangeConstraintManager, just guessing. */ -/* lint1-extra-flags: -chap */ +/* lint1-extra-flags: -chap -X 351 */ void println(const char *); diff --git a/tests/usr.bin/xlint/lint1/expr_sizeof.c b/tests/usr.bin/xlint/lint1/expr_sizeof.c index 6a378d54c74c..2233977e9350 100644 --- a/tests/usr.bin/xlint/lint1/expr_sizeof.c +++ b/tests/usr.bin/xlint/lint1/expr_sizeof.c @@ -1,4 +1,4 @@ -/* $NetBSD: expr_sizeof.c,v 1.4 2023/01/16 00:37:59 rillig Exp $ */ +/* $NetBSD: expr_sizeof.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "expr_sizeof.c" /* @@ -6,6 +6,8 @@ * C11 6.5.3.4 "The sizeof operator" */ +/* lint1-extra-flags: -X 351 */ + /* * A sizeof expression can either take a type name or an expression. */ diff --git a/tests/usr.bin/xlint/lint1/gcc_attribute.c b/tests/usr.bin/xlint/lint1/gcc_attribute.c index dd1e0fdc0aea..ee7bfc442697 100644 --- a/tests/usr.bin/xlint/lint1/gcc_attribute.c +++ b/tests/usr.bin/xlint/lint1/gcc_attribute.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_attribute.c,v 1.12 2022/08/25 19:03:48 rillig Exp $ */ +/* $NetBSD: gcc_attribute.c,v 1.13 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_attribute.c" /* @@ -8,6 +8,8 @@ * https://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html */ +/* lint1-extra-flags: -X 351 */ + void __attribute__((noinline)) do_not_inline(void) { diff --git a/tests/usr.bin/xlint/lint1/gcc_attribute_func.c b/tests/usr.bin/xlint/lint1/gcc_attribute_func.c index b8ba5228c047..97c1485482a5 100644 --- a/tests/usr.bin/xlint/lint1/gcc_attribute_func.c +++ b/tests/usr.bin/xlint/lint1/gcc_attribute_func.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_attribute_func.c,v 1.3 2022/06/11 11:52:13 rillig Exp $ */ +/* $NetBSD: gcc_attribute_func.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_attribute_func.c" /* @@ -7,6 +7,8 @@ * https://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html */ +/* lint1-extra-flags: -X 351 */ + void deprecated_function(void) __attribute__((__noreturn__)) __attribute__((__aligned__(8), __cold__)) diff --git a/tests/usr.bin/xlint/lint1/gcc_attribute_label.c b/tests/usr.bin/xlint/lint1/gcc_attribute_label.c index 3d01e5b59ca2..430c91481df4 100644 --- a/tests/usr.bin/xlint/lint1/gcc_attribute_label.c +++ b/tests/usr.bin/xlint/lint1/gcc_attribute_label.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_attribute_label.c,v 1.3 2022/04/28 21:38:38 rillig Exp $ */ +/* $NetBSD: gcc_attribute_label.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_attribute_label.c" /* @@ -7,6 +7,8 @@ * https://gcc.gnu.org/onlinedocs/gcc/Label-Attributes.html */ +/* lint1-extra-flags: -X 351 */ + void dead(void); void diff --git a/tests/usr.bin/xlint/lint1/gcc_attribute_stmt.c b/tests/usr.bin/xlint/lint1/gcc_attribute_stmt.c index 4002d12bad1f..6b9036c641a6 100644 --- a/tests/usr.bin/xlint/lint1/gcc_attribute_stmt.c +++ b/tests/usr.bin/xlint/lint1/gcc_attribute_stmt.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_attribute_stmt.c,v 1.3 2022/04/28 21:38:38 rillig Exp $ */ +/* $NetBSD: gcc_attribute_stmt.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_attribute_stmt.c" /* @@ -7,6 +7,8 @@ * https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html */ +/* lint1-extra-flags: -X 351 */ + void println(const char *); void diff --git a/tests/usr.bin/xlint/lint1/gcc_attribute_var.c b/tests/usr.bin/xlint/lint1/gcc_attribute_var.c index c4bf00ee889f..7e9c09a6b98a 100644 --- a/tests/usr.bin/xlint/lint1/gcc_attribute_var.c +++ b/tests/usr.bin/xlint/lint1/gcc_attribute_var.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_attribute_var.c,v 1.7 2023/02/05 10:57:48 rillig Exp $ */ +/* $NetBSD: gcc_attribute_var.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_attribute_var.c" /* @@ -7,6 +7,8 @@ * https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html */ +/* lint1-extra-flags: -X 351 */ + void write_to_page(unsigned index, char ch) { diff --git a/tests/usr.bin/xlint/lint1/gcc_bit_field_types.c b/tests/usr.bin/xlint/lint1/gcc_bit_field_types.c index eb3fad08ea78..f43a65c3153b 100644 --- a/tests/usr.bin/xlint/lint1/gcc_bit_field_types.c +++ b/tests/usr.bin/xlint/lint1/gcc_bit_field_types.c @@ -1,6 +1,8 @@ -/* $NetBSD: gcc_bit_field_types.c,v 1.8 2023/01/28 08:36:17 rillig Exp $ */ +/* $NetBSD: gcc_bit_field_types.c,v 1.9 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_bit_field_types.c" +/* lint1-extra-flags: -X 351 */ + struct incompatible { int dummy; }; diff --git a/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c b/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c index 12ae26895e9a..aa646da9ae75 100644 --- a/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c +++ b/tests/usr.bin/xlint/lint1/gcc_init_compound_literal.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_init_compound_literal.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: gcc_init_compound_literal.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_init_compound_literal.c" /* @@ -18,6 +18,8 @@ * temporary objects have neither storage class EXTERN nor STATIC. */ +/* lint1-extra-flags: -X 351 */ + // Seen in sys/crypto/aes/aes_ccm.c. const struct { const unsigned char *ctxt; diff --git a/tests/usr.bin/xlint/lint1/gcc_typeof.c b/tests/usr.bin/xlint/lint1/gcc_typeof.c index 56a36bffbd6a..b672a3448957 100644 --- a/tests/usr.bin/xlint/lint1/gcc_typeof.c +++ b/tests/usr.bin/xlint/lint1/gcc_typeof.c @@ -1,4 +1,4 @@ -/* $NetBSD: gcc_typeof.c,v 1.5 2023/01/21 08:04:43 rillig Exp $ */ +/* $NetBSD: gcc_typeof.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "gcc_typeof.c" /* @@ -7,6 +7,8 @@ * https://gcc.gnu.org/onlinedocs/gcc/Typeof.html */ +/* lint1-extra-flags: -X 351 */ + void take_double(typeof(0.0)); void take_function_double_returning_double( diff --git a/tests/usr.bin/xlint/lint1/init.c b/tests/usr.bin/xlint/lint1/init.c index 06d757474bf1..525f5ee2b963 100644 --- a/tests/usr.bin/xlint/lint1/init.c +++ b/tests/usr.bin/xlint/lint1/init.c @@ -1,4 +1,4 @@ -/* $NetBSD: init.c,v 1.14 2023/01/04 06:04:07 rillig Exp $ */ +/* $NetBSD: init.c,v 1.15 2023/03/28 14:44:34 rillig Exp $ */ # 3 "init.c" /* @@ -7,6 +7,8 @@ * C99 6.7.8 */ +/* lint1-extra-flags: -X 351 */ + /* * C99 does not allow empty initializer braces syntactically. * Lint allows this syntactically, it just complains if the resulting diff --git a/tests/usr.bin/xlint/lint1/init_c90.c b/tests/usr.bin/xlint/lint1/init_c90.c index 813ba0d137ee..86d7f1c134ff 100644 --- a/tests/usr.bin/xlint/lint1/init_c90.c +++ b/tests/usr.bin/xlint/lint1/init_c90.c @@ -1,4 +1,4 @@ -/* $NetBSD: init_c90.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: init_c90.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "init_c90.c" /* @@ -7,7 +7,7 @@ * C90 3.5.7 */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ struct point { int x, y; diff --git a/tests/usr.bin/xlint/lint1/lex_char.c b/tests/usr.bin/xlint/lint1/lex_char.c index 1d672fd9205a..c7f1035042c5 100644 --- a/tests/usr.bin/xlint/lint1/lex_char.c +++ b/tests/usr.bin/xlint/lint1/lex_char.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_char.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: lex_char.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_char.c" /* @@ -7,6 +7,8 @@ * C99 6.4.4.4 "Character constants" */ +/* lint1-extra-flags: -X 351 */ + void sink(char); void diff --git a/tests/usr.bin/xlint/lint1/lex_char_uchar.c b/tests/usr.bin/xlint/lint1/lex_char_uchar.c index f6722a66cef3..429709bb5b7c 100644 --- a/tests/usr.bin/xlint/lint1/lex_char_uchar.c +++ b/tests/usr.bin/xlint/lint1/lex_char_uchar.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_char_uchar.c,v 1.4 2021/08/21 11:50:57 rillig Exp $ */ +/* $NetBSD: lex_char_uchar.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_char_uchar.c" /* @@ -7,6 +7,7 @@ */ /* lint1-only-if: uchar */ +/* lint1-extra-flags: -X 351 */ /* * Before inittyp.c 1.23 from 2021-06-29, the following initialization diff --git a/tests/usr.bin/xlint/lint1/lex_floating.c b/tests/usr.bin/xlint/lint1/lex_floating.c index 3386291174b5..22ce0b4579b1 100644 --- a/tests/usr.bin/xlint/lint1/lex_floating.c +++ b/tests/usr.bin/xlint/lint1/lex_floating.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_floating.c,v 1.3 2023/02/18 14:32:32 rillig Exp $ */ +/* $NetBSD: lex_floating.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_floating.c" /* @@ -7,6 +7,8 @@ * C99 6.4.4.2 "Floating constants" */ +/* lint1-extra-flags: -X 351 */ + void sinkf(float); void sinkd(double); void sinkl(long double); diff --git a/tests/usr.bin/xlint/lint1/lex_integer.c b/tests/usr.bin/xlint/lint1/lex_integer.c index 421f91ae28b5..172acb9469db 100644 --- a/tests/usr.bin/xlint/lint1/lex_integer.c +++ b/tests/usr.bin/xlint/lint1/lex_integer.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_integer.c,v 1.10 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: lex_integer.c,v 1.11 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_integer.c" /* @@ -8,6 +8,7 @@ */ /* lint1-only-if: lp64 */ +/* lint1-extra-flags: -X 351 */ long signed_long; unsigned long long unsigned_long_long_var; diff --git a/tests/usr.bin/xlint/lint1/lex_integer_binary.c b/tests/usr.bin/xlint/lint1/lex_integer_binary.c index 677c0686cfcc..da6283a0c1cf 100644 --- a/tests/usr.bin/xlint/lint1/lex_integer_binary.c +++ b/tests/usr.bin/xlint/lint1/lex_integer_binary.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_integer_binary.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: lex_integer_binary.c,v 1.3 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_integer_binary.c" /* @@ -8,7 +8,7 @@ */ /* Remove the default -g flag. */ -/* lint1-flags: -Ac11 -w */ +/* lint1-flags: -Ac11 -w -X 351 */ void sink(unsigned int); diff --git a/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c b/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c index 975f4dbc52b7..f82025bc1632 100644 --- a/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c +++ b/tests/usr.bin/xlint/lint1/lex_integer_ilp32.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_integer_ilp32.c,v 1.7 2023/02/19 11:50:29 rillig Exp $ */ +/* $NetBSD: lex_integer_ilp32.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_integer_ilp32.c" /* @@ -8,6 +8,7 @@ */ /* lint1-only-if: ilp32 */ +/* lint1-extra-flags: -X 351 */ void sinki(int); void sinku(unsigned int); diff --git a/tests/usr.bin/xlint/lint1/lex_string.c b/tests/usr.bin/xlint/lint1/lex_string.c index ba97ed898e0e..e912119f67ca 100644 --- a/tests/usr.bin/xlint/lint1/lex_string.c +++ b/tests/usr.bin/xlint/lint1/lex_string.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_string.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: lex_string.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_string.c" /* @@ -7,6 +7,8 @@ * C99 6.4.5 "String literals" */ +/* lint1-extra-flags: -X 351 */ + void sink(const char *); void diff --git a/tests/usr.bin/xlint/lint1/lex_wide_char.c b/tests/usr.bin/xlint/lint1/lex_wide_char.c index dd41cee78946..2734dd53b49a 100644 --- a/tests/usr.bin/xlint/lint1/lex_wide_char.c +++ b/tests/usr.bin/xlint/lint1/lex_wide_char.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_wide_char.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: lex_wide_char.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_wide_char.c" /* @@ -7,6 +7,8 @@ * C99 6.4.4.4 "Character constants" */ +/* lint1-extra-flags: -X 351 */ + void sink(int); void diff --git a/tests/usr.bin/xlint/lint1/lex_wide_string.c b/tests/usr.bin/xlint/lint1/lex_wide_string.c index 402eacf8f31d..48c06d1aa6b3 100644 --- a/tests/usr.bin/xlint/lint1/lex_wide_string.c +++ b/tests/usr.bin/xlint/lint1/lex_wide_string.c @@ -1,4 +1,4 @@ -/* $NetBSD: lex_wide_string.c,v 1.3 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: lex_wide_string.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "lex_wide_string.c" /* @@ -7,6 +7,8 @@ * C99 6.4.5 "String literals" */ +/* lint1-extra-flags: -X 351 */ + void sink(const int *); void diff --git a/tests/usr.bin/xlint/lint1/msg_000.c b/tests/usr.bin/xlint/lint1/msg_000.c index e442e7225d7d..6494650741b3 100644 --- a/tests/usr.bin/xlint/lint1/msg_000.c +++ b/tests/usr.bin/xlint/lint1/msg_000.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_000.c,v 1.4 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_000.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_000.c" // Test for message: empty declaration [0] +/* lint1-extra-flags: -X 351 */ + extern int extern_declared; /* expect+1: warning: empty declaration [0] */ diff --git a/tests/usr.bin/xlint/lint1/msg_001.c b/tests/usr.bin/xlint/lint1/msg_001.c index 53506010208b..a5d9ff87bed1 100644 --- a/tests/usr.bin/xlint/lint1/msg_001.c +++ b/tests/usr.bin/xlint/lint1/msg_001.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_001.c,v 1.8 2022/10/01 09:42:40 rillig Exp $ */ +/* $NetBSD: msg_001.c,v 1.9 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_001.c" // Test for message: old-style declaration; add 'int' [1] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: old-style declaration; add 'int' [1] */ old_style = 1; diff --git a/tests/usr.bin/xlint/lint1/msg_001_c90.c b/tests/usr.bin/xlint/lint1/msg_001_c90.c index 93d63e5d7895..ff7f389b73ad 100644 --- a/tests/usr.bin/xlint/lint1/msg_001_c90.c +++ b/tests/usr.bin/xlint/lint1/msg_001_c90.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_001_c90.c,v 1.2 2022/10/01 09:42:40 rillig Exp $ */ +/* $NetBSD: msg_001_c90.c,v 1.3 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_001_c90.c" /* @@ -8,7 +8,7 @@ * warning. */ -/* lint1-flags: -s */ +/* lint1-flags: -s -X 351 */ /* expect+1: error: old-style declaration; add 'int' [1] */ implicit_global_variable; diff --git a/tests/usr.bin/xlint/lint1/msg_002.c b/tests/usr.bin/xlint/lint1/msg_002.c index 0b4d9878cf45..8e49bb51fec9 100644 --- a/tests/usr.bin/xlint/lint1/msg_002.c +++ b/tests/usr.bin/xlint/lint1/msg_002.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_002.c,v 1.5 2021/07/14 20:39:13 rillig Exp $ */ +/* $NetBSD: msg_002.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_002.c" // Test for message: empty declaration [2] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: empty declaration [2] */ int; diff --git a/tests/usr.bin/xlint/lint1/msg_004.c b/tests/usr.bin/xlint/lint1/msg_004.c index 2e3b75a81a8c..1ee74752268d 100644 --- a/tests/usr.bin/xlint/lint1/msg_004.c +++ b/tests/usr.bin/xlint/lint1/msg_004.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_004.c,v 1.6 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_004.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_004.c" // Test for message: illegal type combination [4] +/* lint1-extra-flags: -X 351 */ + // Lint does not detect "two or more data types", but GCC does. signed double signed_double; diff --git a/tests/usr.bin/xlint/lint1/msg_006.c b/tests/usr.bin/xlint/lint1/msg_006.c index 127ebd7a3d1d..c25a062449a0 100644 --- a/tests/usr.bin/xlint/lint1/msg_006.c +++ b/tests/usr.bin/xlint/lint1/msg_006.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_006.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_006.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_006.c" // Test for message: use 'double' instead of 'long float' [6] +/* lint1-extra-flags: -X 351 */ + /* expect+2: warning: use 'double' instead of 'long float' [6] */ /* expect+1: error: illegal type combination [4] */ long float x; diff --git a/tests/usr.bin/xlint/lint1/msg_007.c b/tests/usr.bin/xlint/lint1/msg_007.c index f7903471bd57..343dc168aaf1 100644 --- a/tests/usr.bin/xlint/lint1/msg_007.c +++ b/tests/usr.bin/xlint/lint1/msg_007.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_007.c,v 1.5 2022/10/01 09:42:40 rillig Exp $ */ +/* $NetBSD: msg_007.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_007.c" // Test for message: only one storage class allowed [7] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: only one storage class allowed [7] */ extern static void example(void); diff --git a/tests/usr.bin/xlint/lint1/msg_009.c b/tests/usr.bin/xlint/lint1/msg_009.c index ca148a4b90b0..82d87ec71958 100644 --- a/tests/usr.bin/xlint/lint1/msg_009.c +++ b/tests/usr.bin/xlint/lint1/msg_009.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_009.c,v 1.4 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_009.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_009.c" // Test for message: only register valid as formal parameter storage class [9] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: only register valid as formal parameter storage class [9] */ extern void typedef_example(typedef int param); /* expect+1: error: only register valid as formal parameter storage class [9] */ diff --git a/tests/usr.bin/xlint/lint1/msg_010.c b/tests/usr.bin/xlint/lint1/msg_010.c index 6e770157bf7b..fe576342f578 100644 --- a/tests/usr.bin/xlint/lint1/msg_010.c +++ b/tests/usr.bin/xlint/lint1/msg_010.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_010.c,v 1.5 2022/04/30 20:24:57 rillig Exp $ */ +/* $NetBSD: msg_010.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_010.c" // Test for message: duplicate '%s' [10] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: duplicate 'inline' [10] */ inline inline void double_inline(void) diff --git a/tests/usr.bin/xlint/lint1/msg_013.c b/tests/usr.bin/xlint/lint1/msg_013.c index 63dfab550d64..34d1f0199da3 100644 --- a/tests/usr.bin/xlint/lint1/msg_013.c +++ b/tests/usr.bin/xlint/lint1/msg_013.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_013.c,v 1.4 2022/06/11 12:24:00 rillig Exp $ */ +/* $NetBSD: msg_013.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_013.c" // Test for message: incomplete enum type '%s' [13] +/* lint1-extra-flags: -X 351 */ + enum tag; /* XXX: why ''? */ diff --git a/tests/usr.bin/xlint/lint1/msg_014.c b/tests/usr.bin/xlint/lint1/msg_014.c index 836d7e4fe932..09032ef03f91 100644 --- a/tests/usr.bin/xlint/lint1/msg_014.c +++ b/tests/usr.bin/xlint/lint1/msg_014.c @@ -1,9 +1,11 @@ -/* $NetBSD: msg_014.c,v 1.7 2022/05/12 00:18:35 rillig Exp $ */ +/* $NetBSD: msg_014.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_014.c" // Test for message: compiler takes alignment of function [14] /* This message is not used. */ +/* lint1-extra-flags: -X 351 */ + typedef void function(void); /* expect+1: error: cannot take size/alignment of function type 'function(void) returning void' [144] */ diff --git a/tests/usr.bin/xlint/lint1/msg_015.c b/tests/usr.bin/xlint/lint1/msg_015.c index de6e9be64f87..19df92a32bae 100644 --- a/tests/usr.bin/xlint/lint1/msg_015.c +++ b/tests/usr.bin/xlint/lint1/msg_015.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_015.c,v 1.4 2022/04/01 22:07:23 rillig Exp $ */ +/* $NetBSD: msg_015.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_015.c" // Test for message: function returns illegal type '%s' [15] +/* lint1-extra-flags: -X 351 */ + typedef int array[5]; /* expect+1: error: function returns illegal type 'array[5] of int' [15] */ diff --git a/tests/usr.bin/xlint/lint1/msg_016.c b/tests/usr.bin/xlint/lint1/msg_016.c index ac875d309136..2966e0228e6b 100644 --- a/tests/usr.bin/xlint/lint1/msg_016.c +++ b/tests/usr.bin/xlint/lint1/msg_016.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_016.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_016.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_016.c" // Test for message: array of function is illegal [16] +/* lint1-extra-flags: -X 351 */ + typedef void function(void); /* expect+1: error: array of function is illegal [16] */ diff --git a/tests/usr.bin/xlint/lint1/msg_017.c b/tests/usr.bin/xlint/lint1/msg_017.c index d3af7748feed..21d7bbee7378 100644 --- a/tests/usr.bin/xlint/lint1/msg_017.c +++ b/tests/usr.bin/xlint/lint1/msg_017.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_017.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_017.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_017.c" // Test for message: null dimension [17] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: empty array declaration for 'empty_array_var' [190] */ int empty_array_var[0]; diff --git a/tests/usr.bin/xlint/lint1/msg_018.c b/tests/usr.bin/xlint/lint1/msg_018.c index 90763a6bf5f0..30196f1bc9b0 100644 --- a/tests/usr.bin/xlint/lint1/msg_018.c +++ b/tests/usr.bin/xlint/lint1/msg_018.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_018.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_018.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_018.c" // Test for message: illegal use of 'void' [18] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: void type for 'x' [19] */ void x; diff --git a/tests/usr.bin/xlint/lint1/msg_019.c b/tests/usr.bin/xlint/lint1/msg_019.c index f1310c4920f9..ad86c08d2ed9 100644 --- a/tests/usr.bin/xlint/lint1/msg_019.c +++ b/tests/usr.bin/xlint/lint1/msg_019.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_019.c,v 1.6 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_019.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_019.c" // Test for message: void type for '%s' [19] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: void type for 'global_variable' [19] */ void global_variable; diff --git a/tests/usr.bin/xlint/lint1/msg_020.c b/tests/usr.bin/xlint/lint1/msg_020.c index 7698451b53aa..70fd34e88e4e 100644 --- a/tests/usr.bin/xlint/lint1/msg_020.c +++ b/tests/usr.bin/xlint/lint1/msg_020.c @@ -1,7 +1,9 @@ -/* $NetBSD: msg_020.c,v 1.3 2021/08/27 20:16:50 rillig Exp $ */ +/* $NetBSD: msg_020.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_020.c" // Test for message: negative array dimension (%d) [20] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: negative array dimension (-3) [20] */ int array[-3]; diff --git a/tests/usr.bin/xlint/lint1/msg_022.c b/tests/usr.bin/xlint/lint1/msg_022.c index bb2059a9ac0d..8841e1541887 100644 --- a/tests/usr.bin/xlint/lint1/msg_022.c +++ b/tests/usr.bin/xlint/lint1/msg_022.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_022.c,v 1.5 2022/10/01 09:42:40 rillig Exp $ */ +/* $NetBSD: msg_022.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_022.c" // Test for message: incomplete or misplaced function definition [22] +/* lint1-extra-flags: -X 351 */ + /* * Before decl.c 1.264 and func.c 1.130 from 2022-04-02, lint ran into * assertion failures after trying to recover from the below syntax error. diff --git a/tests/usr.bin/xlint/lint1/msg_024.c b/tests/usr.bin/xlint/lint1/msg_024.c index e1ff583b8ac3..27ff917dd977 100644 --- a/tests/usr.bin/xlint/lint1/msg_024.c +++ b/tests/usr.bin/xlint/lint1/msg_024.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_024.c,v 1.4 2022/06/19 11:50:42 rillig Exp $ */ +/* $NetBSD: msg_024.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_024.c" // Test for message: cannot initialize function '%s' [24] +/* lint1-extra-flags: -X 351 */ + typedef void (function)(void); void diff --git a/tests/usr.bin/xlint/lint1/msg_026.c b/tests/usr.bin/xlint/lint1/msg_026.c index 2301fdccb1a3..7d8c251b5efb 100644 --- a/tests/usr.bin/xlint/lint1/msg_026.c +++ b/tests/usr.bin/xlint/lint1/msg_026.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_026.c,v 1.4 2022/06/19 11:50:42 rillig Exp $ */ +/* $NetBSD: msg_026.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_026.c" // Test for message: cannot initialize extern declaration '%s' [26] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: cannot initialize extern declaration 'used' [26] */ extern int used = 1; int defined = 1; diff --git a/tests/usr.bin/xlint/lint1/msg_027.c b/tests/usr.bin/xlint/lint1/msg_027.c index 1607718fc0df..ccb9d73fd8a5 100644 --- a/tests/usr.bin/xlint/lint1/msg_027.c +++ b/tests/usr.bin/xlint/lint1/msg_027.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_027.c,v 1.7 2022/06/11 12:24:00 rillig Exp $ */ +/* $NetBSD: msg_027.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_027.c" // Test for message: redeclaration of '%s' [27] +/* lint1-extra-flags: -X 351 */ + extern int identifier(void); /* expect+1: error: redeclaration of 'identifier' with type 'function(void) returning double', expected 'function(void) returning int' [347] */ diff --git a/tests/usr.bin/xlint/lint1/msg_029.c b/tests/usr.bin/xlint/lint1/msg_029.c index a7291f1ee31a..ba193fb29662 100644 --- a/tests/usr.bin/xlint/lint1/msg_029.c +++ b/tests/usr.bin/xlint/lint1/msg_029.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_029.c,v 1.5 2022/06/19 11:50:42 rillig Exp $ */ +/* $NetBSD: msg_029.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_029.c" // Test for message: '%s' was previously declared extern, becomes static [29] +/* lint1-extra-flags: -X 351 */ + extern int function(void); static int function(void) diff --git a/tests/usr.bin/xlint/lint1/msg_031.c b/tests/usr.bin/xlint/lint1/msg_031.c index 8987dbc3cb72..a95eafe89513 100644 --- a/tests/usr.bin/xlint/lint1/msg_031.c +++ b/tests/usr.bin/xlint/lint1/msg_031.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_031.c,v 1.8 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_031.c,v 1.9 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_031.c" // Test for message: '%s' has incomplete type '%s' [31] +/* lint1-extra-flags: -X 351 */ + struct complete { int dummy; }; diff --git a/tests/usr.bin/xlint/lint1/msg_038.c b/tests/usr.bin/xlint/lint1/msg_038.c index 2eb4711876d8..978144bea360 100644 --- a/tests/usr.bin/xlint/lint1/msg_038.c +++ b/tests/usr.bin/xlint/lint1/msg_038.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_038.c,v 1.3 2021/08/27 20:16:50 rillig Exp $ */ +/* $NetBSD: msg_038.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_038.c" // Test for message: function illegal in structure or union [38] +/* lint1-extra-flags: -X 351 */ + typedef void (function)(void); struct { diff --git a/tests/usr.bin/xlint/lint1/msg_040.c b/tests/usr.bin/xlint/lint1/msg_040.c index 15c1bea340de..1e3438514633 100644 --- a/tests/usr.bin/xlint/lint1/msg_040.c +++ b/tests/usr.bin/xlint/lint1/msg_040.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_040.c,v 1.3 2022/04/05 23:09:19 rillig Exp $ */ +/* $NetBSD: msg_040.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_040.c" // Test for message: unknown size: %s [40] @@ -6,4 +6,4 @@ /* lint1-flags: -Sw */ -int var; +typedef int dummy; diff --git a/tests/usr.bin/xlint/lint1/msg_044.c b/tests/usr.bin/xlint/lint1/msg_044.c index f36dcd907e23..05b80f3a89fc 100644 --- a/tests/usr.bin/xlint/lint1/msg_044.c +++ b/tests/usr.bin/xlint/lint1/msg_044.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_044.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_044.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_044.c" // Test for message: declaration of '%s %s' introduces new type in ANSI C [44] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: struct 'tag' never defined [233] */ struct tag; diff --git a/tests/usr.bin/xlint/lint1/msg_046.c b/tests/usr.bin/xlint/lint1/msg_046.c index 6f1147b3e890..b84b0a030658 100644 --- a/tests/usr.bin/xlint/lint1/msg_046.c +++ b/tests/usr.bin/xlint/lint1/msg_046.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_046.c,v 1.5 2022/06/11 11:52:13 rillig Exp $ */ +/* $NetBSD: msg_046.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_046.c" // Test for message: %s tag '%s' redeclared as %s [46] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: struct 'tag1' never defined [233] */ struct tag1; /* expect+2: error: struct tag 'tag1' redeclared as union [46] */ diff --git a/tests/usr.bin/xlint/lint1/msg_049.c b/tests/usr.bin/xlint/lint1/msg_049.c index 599f5491ac4c..4afa65ba4d47 100644 --- a/tests/usr.bin/xlint/lint1/msg_049.c +++ b/tests/usr.bin/xlint/lint1/msg_049.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_049.c,v 1.5 2022/04/24 15:55:50 rillig Exp $ */ +/* $NetBSD: msg_049.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_049.c" /* Test for message: anonymous struct/union members is a C11 feature [49] */ -/* lint1-flags: -Sw */ +/* lint1-flags: -Sw -X 351 */ struct { unsigned int flag: 1; diff --git a/tests/usr.bin/xlint/lint1/msg_051.c b/tests/usr.bin/xlint/lint1/msg_051.c index 79b770dff2ec..1f61f75bcd48 100644 --- a/tests/usr.bin/xlint/lint1/msg_051.c +++ b/tests/usr.bin/xlint/lint1/msg_051.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_051.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_051.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_051.c" // Test for message: parameter mismatch: %d declared, %d defined [51] +/* lint1-extra-flags: -X 351 */ + void example(int, int); diff --git a/tests/usr.bin/xlint/lint1/msg_058.c b/tests/usr.bin/xlint/lint1/msg_058.c index c62e4a3c4dd5..d8780319ef77 100644 --- a/tests/usr.bin/xlint/lint1/msg_058.c +++ b/tests/usr.bin/xlint/lint1/msg_058.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_058.c,v 1.4 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_058.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_058.c" // Test for message: type of '%s' does not match prototype [58] +/* lint1-extra-flags: -X 351 */ + int function(int, char, const char *); int diff --git a/tests/usr.bin/xlint/lint1/msg_060.c b/tests/usr.bin/xlint/lint1/msg_060.c index 5775ac0c7b2c..a1be7c13e4e4 100644 --- a/tests/usr.bin/xlint/lint1/msg_060.c +++ b/tests/usr.bin/xlint/lint1/msg_060.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_060.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_060.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_060.c" // Test for message: void must be sole parameter [60] +/* lint1-extra-flags: -X 351 */ + void example_1(void); /* expect+1: error: void must be sole parameter [60] */ diff --git a/tests/usr.bin/xlint/lint1/msg_061.c b/tests/usr.bin/xlint/lint1/msg_061.c index 0f4ee7b4e6bc..4ef078f08609 100644 --- a/tests/usr.bin/xlint/lint1/msg_061.c +++ b/tests/usr.bin/xlint/lint1/msg_061.c @@ -1,7 +1,9 @@ -/* $NetBSD: msg_061.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_061.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_061.c" // Test for message: void parameter '%s' cannot have name [61] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: void parameter 'arg' cannot have name [61] */ void example(void arg); diff --git a/tests/usr.bin/xlint/lint1/msg_067.c b/tests/usr.bin/xlint/lint1/msg_067.c index 9b41ddac9374..79e1a5bc3a71 100644 --- a/tests/usr.bin/xlint/lint1/msg_067.c +++ b/tests/usr.bin/xlint/lint1/msg_067.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_067.c,v 1.5 2022/06/11 11:52:13 rillig Exp $ */ +/* $NetBSD: msg_067.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_067.c" // Test for message: cannot return incomplete type [67] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: struct 'incomplete' never defined [233] */ struct incomplete; diff --git a/tests/usr.bin/xlint/lint1/msg_068.c b/tests/usr.bin/xlint/lint1/msg_068.c index 42cb79f7d41c..b123aea160ce 100644 --- a/tests/usr.bin/xlint/lint1/msg_068.c +++ b/tests/usr.bin/xlint/lint1/msg_068.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_068.c,v 1.4 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_068.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_068.c" // Test for message: typedef already qualified with '%s' [68] +/* lint1-extra-flags: -X 351 */ + typedef const char const_char; /* expect+1: warning: typedef already qualified with 'const' [68] */ diff --git a/tests/usr.bin/xlint/lint1/msg_069.c b/tests/usr.bin/xlint/lint1/msg_069.c index cbc3d498b854..e5b34aa49dd9 100644 --- a/tests/usr.bin/xlint/lint1/msg_069.c +++ b/tests/usr.bin/xlint/lint1/msg_069.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_069.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_069.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_069.c" // Test for message: inappropriate qualifiers with 'void' [69] +/* lint1-extra-flags: -X 351 */ + /* expect+2: error: void type for 'const_void' [19] */ /* expect+1: warning: inappropriate qualifiers with 'void' [69] */ const void const_void; diff --git a/tests/usr.bin/xlint/lint1/msg_070.c b/tests/usr.bin/xlint/lint1/msg_070.c index 7822fc1b0a0a..6c4e3d1f8196 100644 --- a/tests/usr.bin/xlint/lint1/msg_070.c +++ b/tests/usr.bin/xlint/lint1/msg_070.c @@ -1,7 +1,7 @@ -/* $NetBSD: msg_070.c,v 1.3 2022/04/08 21:29:29 rillig Exp $ */ +/* $NetBSD: msg_070.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_070.c" // Test for message: %soperand of '%s' is unsigned in ANSI C [70] /* This message is not used. */ -int var; +typedef int dummy; diff --git a/tests/usr.bin/xlint/lint1/msg_071.c b/tests/usr.bin/xlint/lint1/msg_071.c index e25ba1349aaa..164bf6777929 100644 --- a/tests/usr.bin/xlint/lint1/msg_071.c +++ b/tests/usr.bin/xlint/lint1/msg_071.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_071.c,v 1.6 2023/01/22 16:05:08 rillig Exp $ */ +/* $NetBSD: msg_071.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_071.c" // Test for message: too many characters in character constant [71] +/* lint1-extra-flags: -X 351 */ + /* * See also: * lex_char.c diff --git a/tests/usr.bin/xlint/lint1/msg_073.c b/tests/usr.bin/xlint/lint1/msg_073.c index 2a9526d3f921..cbf14a2ead59 100644 --- a/tests/usr.bin/xlint/lint1/msg_073.c +++ b/tests/usr.bin/xlint/lint1/msg_073.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_073.c,v 1.4 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_073.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_073.c" // Test for message: empty character constant [73] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: empty character constant [73] */ char empty = ''; char letter = 'x'; diff --git a/tests/usr.bin/xlint/lint1/msg_074.c b/tests/usr.bin/xlint/lint1/msg_074.c index b8addf3a2a0f..dc09f8907396 100644 --- a/tests/usr.bin/xlint/lint1/msg_074.c +++ b/tests/usr.bin/xlint/lint1/msg_074.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_074.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_074.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_074.c" // Test for message: no hex digits follow \x [74] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: no hex digits follow \x [74] */ char invalid_hex = '\x'; diff --git a/tests/usr.bin/xlint/lint1/msg_075.c b/tests/usr.bin/xlint/lint1/msg_075.c index 2f11721f66a3..29241080c0e5 100644 --- a/tests/usr.bin/xlint/lint1/msg_075.c +++ b/tests/usr.bin/xlint/lint1/msg_075.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_075.c,v 1.5 2023/01/22 16:05:08 rillig Exp $ */ +/* $NetBSD: msg_075.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_075.c" // Test for message: overflow in hex escape [75] +/* lint1-extra-flags: -X 351 */ + /* * See also: * lex_char.c diff --git a/tests/usr.bin/xlint/lint1/msg_076.c b/tests/usr.bin/xlint/lint1/msg_076.c index 4b6b456000f8..86b8121a7aad 100644 --- a/tests/usr.bin/xlint/lint1/msg_076.c +++ b/tests/usr.bin/xlint/lint1/msg_076.c @@ -1,7 +1,9 @@ -/* $NetBSD: msg_076.c,v 1.4 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_076.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_076.c" // Test for message: character escape does not fit in character [76] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: character escape does not fit in character [76] */ char ch = '\777'; diff --git a/tests/usr.bin/xlint/lint1/msg_077.c b/tests/usr.bin/xlint/lint1/msg_077.c index b662bf8e05f8..df9e8e4bb6c2 100644 --- a/tests/usr.bin/xlint/lint1/msg_077.c +++ b/tests/usr.bin/xlint/lint1/msg_077.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_077.c,v 1.6 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_077.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_077.c" /* Test for message: bad octal digit %c [77] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ /* expect+1: warning: bad octal digit 8 [77] */ char single_digit = '\8'; diff --git a/tests/usr.bin/xlint/lint1/msg_078.c b/tests/usr.bin/xlint/lint1/msg_078.c index 480fdaef7d02..52e632cfda3e 100644 --- a/tests/usr.bin/xlint/lint1/msg_078.c +++ b/tests/usr.bin/xlint/lint1/msg_078.c @@ -1,9 +1,11 @@ -/* $NetBSD: msg_078.c,v 1.4 2021/08/27 20:19:45 rillig Exp $ */ +/* $NetBSD: msg_078.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_078.c" // Test for message: nonportable character escape [78] /* This message is not used. */ +/* lint1-extra-flags: -X 351 */ + char either_255_or_minus_1 = '\377'; /* expect+1: warning: dubious escape \y [79] */ char dubious_escape = '\y'; diff --git a/tests/usr.bin/xlint/lint1/msg_079.c b/tests/usr.bin/xlint/lint1/msg_079.c index d649f6d13245..4e590a2df243 100644 --- a/tests/usr.bin/xlint/lint1/msg_079.c +++ b/tests/usr.bin/xlint/lint1/msg_079.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_079.c,v 1.3 2021/08/27 20:16:50 rillig Exp $ */ +/* $NetBSD: msg_079.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_079.c" // Test for message: dubious escape \%c [79] +/* lint1-extra-flags: -X 351 */ + int my_printf(const char *, ...); void diff --git a/tests/usr.bin/xlint/lint1/msg_080.c b/tests/usr.bin/xlint/lint1/msg_080.c index 3eee7df8df5e..60c5fca1f1a6 100644 --- a/tests/usr.bin/xlint/lint1/msg_080.c +++ b/tests/usr.bin/xlint/lint1/msg_080.c @@ -1,7 +1,9 @@ -/* $NetBSD: msg_080.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_080.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_080.c" // Test for message: dubious escape \%o [80] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: dubious escape \177 [80] */ char backslash_delete = '\'; diff --git a/tests/usr.bin/xlint/lint1/msg_081.c b/tests/usr.bin/xlint/lint1/msg_081.c index 82bf53c9c9ce..3dda84b71904 100644 --- a/tests/usr.bin/xlint/lint1/msg_081.c +++ b/tests/usr.bin/xlint/lint1/msg_081.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_081.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_081.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_081.c" /* Test for message: \a undefined in traditional C [81] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ /* expect+1: warning: \a undefined in traditional C [81] */ char str[] = "The bell\a rings"; diff --git a/tests/usr.bin/xlint/lint1/msg_082.c b/tests/usr.bin/xlint/lint1/msg_082.c index 3197451d1bd0..1301abcb9459 100644 --- a/tests/usr.bin/xlint/lint1/msg_082.c +++ b/tests/usr.bin/xlint/lint1/msg_082.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_082.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_082.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_082.c" /* Test for message: \x undefined in traditional C [82] */ -/* lint1-flags: -Stw */ +/* lint1-flags: -Stw -X 351 */ /* expect+1: warning: \x undefined in traditional C [82] */ char str[] = "A he\x78 escape"; diff --git a/tests/usr.bin/xlint/lint1/msg_083.c b/tests/usr.bin/xlint/lint1/msg_083.c index 88280104d6af..e309c863ad1e 100644 --- a/tests/usr.bin/xlint/lint1/msg_083.c +++ b/tests/usr.bin/xlint/lint1/msg_083.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_083.c,v 1.5 2022/06/15 20:18:31 rillig Exp $ */ +/* $NetBSD: msg_083.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_083.c" // Test for message: storage class after type is obsolescent [83] +/* lint1-extra-flags: -X 351 */ + void example(void) { diff --git a/tests/usr.bin/xlint/lint1/msg_085.c b/tests/usr.bin/xlint/lint1/msg_085.c index 14b1e655d3bd..a18d9cab5d85 100644 --- a/tests/usr.bin/xlint/lint1/msg_085.c +++ b/tests/usr.bin/xlint/lint1/msg_085.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_085.c,v 1.5 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: msg_085.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_085.c" // Test for message: dubious tag declaration '%s %s' [85] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: dubious tag declaration 'struct in_argument' [85] */ void declare_struct(struct in_argument *); /* expect+1: warning: dubious tag declaration 'union in_argument' [85] */ diff --git a/tests/usr.bin/xlint/lint1/msg_086.c b/tests/usr.bin/xlint/lint1/msg_086.c index f4fc587b2c8f..40ad2307e960 100644 --- a/tests/usr.bin/xlint/lint1/msg_086.c +++ b/tests/usr.bin/xlint/lint1/msg_086.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_086.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_086.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_086.c" // Test for message: automatic '%s' hides external declaration [86] -/* lint1-flags: -S -g -h -w */ +/* lint1-flags: -S -g -h -w -X 351 */ extern int identifier; diff --git a/tests/usr.bin/xlint/lint1/msg_087.c b/tests/usr.bin/xlint/lint1/msg_087.c index 047183d280cf..22304f7447b7 100644 --- a/tests/usr.bin/xlint/lint1/msg_087.c +++ b/tests/usr.bin/xlint/lint1/msg_087.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_087.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_087.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_087.c" // Test for message: static '%s' hides external declaration [87] -/* lint1-flags: -g -h -S -w */ +/* lint1-flags: -g -h -S -w -X 351 */ extern int counter; diff --git a/tests/usr.bin/xlint/lint1/msg_088.c b/tests/usr.bin/xlint/lint1/msg_088.c index 6726f708ee5c..f90a637340dc 100644 --- a/tests/usr.bin/xlint/lint1/msg_088.c +++ b/tests/usr.bin/xlint/lint1/msg_088.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_088.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_088.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_088.c" // Test for message: typedef '%s' hides external declaration [88] -/* lint1-flags: -g -h -S -w */ +/* lint1-flags: -g -h -S -w -X 351 */ extern int identifier; diff --git a/tests/usr.bin/xlint/lint1/msg_090.c b/tests/usr.bin/xlint/lint1/msg_090.c index 525a5aeedc7e..c5d61684ccb5 100644 --- a/tests/usr.bin/xlint/lint1/msg_090.c +++ b/tests/usr.bin/xlint/lint1/msg_090.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_090.c,v 1.4 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: msg_090.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_090.c" // Test for message: inconsistent redeclaration of extern '%s' [90] +/* lint1-extra-flags: -X 351 */ + extern int random_number(void); void diff --git a/tests/usr.bin/xlint/lint1/msg_095.c b/tests/usr.bin/xlint/lint1/msg_095.c index d03de5bde38e..cac45ae939a2 100644 --- a/tests/usr.bin/xlint/lint1/msg_095.c +++ b/tests/usr.bin/xlint/lint1/msg_095.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_095.c,v 1.5 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: msg_095.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_095.c" // Test for message: declaration of '%s' hides earlier one [95] -/* lint1-flags: -ghSw */ +/* lint1-flags: -ghSw -X 351 */ int identifier; diff --git a/tests/usr.bin/xlint/lint1/msg_101.c b/tests/usr.bin/xlint/lint1/msg_101.c index 17d3ccfe780a..155e3df7de4b 100644 --- a/tests/usr.bin/xlint/lint1/msg_101.c +++ b/tests/usr.bin/xlint/lint1/msg_101.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_101.c,v 1.9 2021/07/04 17:28:06 rillig Exp $ */ +/* $NetBSD: msg_101.c,v 1.10 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_101.c" // Test for message: type '%s' does not have member '%s' [101] +/* lint1-extra-flags: -X 351 */ + struct point { int x, y; }; diff --git a/tests/usr.bin/xlint/lint1/msg_112.c b/tests/usr.bin/xlint/lint1/msg_112.c index 16ecfc64954e..15e02fd73f4f 100644 --- a/tests/usr.bin/xlint/lint1/msg_112.c +++ b/tests/usr.bin/xlint/lint1/msg_112.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_112.c,v 1.3 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_112.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_112.c" // Test for message: cannot take address of bit-field [112] +/* lint1-extra-flags: -X 351 */ + struct { int bit_field:1; } s; diff --git a/tests/usr.bin/xlint/lint1/msg_115.c b/tests/usr.bin/xlint/lint1/msg_115.c index 5dd88cf020c9..93e10facd8c3 100644 --- a/tests/usr.bin/xlint/lint1/msg_115.c +++ b/tests/usr.bin/xlint/lint1/msg_115.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_115.c,v 1.10 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_115.c,v 1.11 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_115.c" // Test for message: %soperand of '%s' must be modifiable lvalue [115] +/* lint1-extra-flags: -X 351 */ + void example(const int *const_ptr) { diff --git a/tests/usr.bin/xlint/lint1/msg_123.c b/tests/usr.bin/xlint/lint1/msg_123.c index 486fac4116d8..50248ca346ef 100644 --- a/tests/usr.bin/xlint/lint1/msg_123.c +++ b/tests/usr.bin/xlint/lint1/msg_123.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_123.c,v 1.6 2022/06/19 12:14:34 rillig Exp $ */ +/* $NetBSD: msg_123.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_123.c" // Test for message: illegal combination of %s '%s' and %s '%s', op '%s' [123] +/* lint1-extra-flags: -X 351 */ + void ok(_Bool); void bad(_Bool); diff --git a/tests/usr.bin/xlint/lint1/msg_124.c b/tests/usr.bin/xlint/lint1/msg_124.c index 1f00ce92ed42..ebf80f3636b6 100644 --- a/tests/usr.bin/xlint/lint1/msg_124.c +++ b/tests/usr.bin/xlint/lint1/msg_124.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_124.c,v 1.12 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_124.c,v 1.13 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_124.c" // Test for message: illegal combination of '%s' and '%s', op '%s' [124] -/* lint1-extra-flags: -s */ +/* lint1-extra-flags: -s -X 351 */ typedef void(*signal_handler)(int); diff --git a/tests/usr.bin/xlint/lint1/msg_129.c b/tests/usr.bin/xlint/lint1/msg_129.c index 3b7371b84afc..11162f11fd25 100644 --- a/tests/usr.bin/xlint/lint1/msg_129.c +++ b/tests/usr.bin/xlint/lint1/msg_129.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_129.c,v 1.6 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_129.c,v 1.7 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_129.c" // Test for message: expression has null effect [129] -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ typedef unsigned char uint8_t; typedef unsigned int uint32_t; diff --git a/tests/usr.bin/xlint/lint1/msg_130.c b/tests/usr.bin/xlint/lint1/msg_130.c index 257cddbd2d32..078e033f73b6 100644 --- a/tests/usr.bin/xlint/lint1/msg_130.c +++ b/tests/usr.bin/xlint/lint1/msg_130.c @@ -1,10 +1,12 @@ -/* $NetBSD: msg_130.c,v 1.15 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_130.c,v 1.16 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_130.c" // Test for message: enum type mismatch: '%s' '%s' '%s' [130] /* See also msg_241.c, which covers unusual operators on enums. */ +/* lint1-extra-flags: -X 351 */ + enum color { RED = 1 << 0, GREEN = 1 << 1, diff --git a/tests/usr.bin/xlint/lint1/msg_131.c b/tests/usr.bin/xlint/lint1/msg_131.c index 77ecd3046da6..907e234015ff 100644 --- a/tests/usr.bin/xlint/lint1/msg_131.c +++ b/tests/usr.bin/xlint/lint1/msg_131.c @@ -1,7 +1,7 @@ -/* $NetBSD: msg_131.c,v 1.3 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_131.c,v 1.4 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_131.c" // Test for message: conversion to '%s' may sign-extend incorrectly [131] // This message is not used. -int dummy; +typedef int dummy; diff --git a/tests/usr.bin/xlint/lint1/msg_132.c b/tests/usr.bin/xlint/lint1/msg_132.c index 3ee50575ce69..d253ec5aaea4 100644 --- a/tests/usr.bin/xlint/lint1/msg_132.c +++ b/tests/usr.bin/xlint/lint1/msg_132.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_132.c,v 1.25 2023/01/29 17:02:09 rillig Exp $ */ +/* $NetBSD: msg_132.c,v 1.26 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_132.c" // Test for message: conversion from '%s' to '%s' may lose accuracy [132] +/* lint1-extra-flags: -X 351 */ + /* * NetBSD's default lint flags only include a single -a, which only flags * narrowing conversions from long. To get warnings for all narrowing diff --git a/tests/usr.bin/xlint/lint1/msg_132_ilp32.c b/tests/usr.bin/xlint/lint1/msg_132_ilp32.c index a17e548b4a84..d497c1e9614e 100644 --- a/tests/usr.bin/xlint/lint1/msg_132_ilp32.c +++ b/tests/usr.bin/xlint/lint1/msg_132_ilp32.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_132_ilp32.c,v 1.2 2022/06/10 18:29:01 rillig Exp $ */ +/* $NetBSD: msg_132_ilp32.c,v 1.3 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_132_ilp32.c" // Test for message: conversion from '%s' to '%s' may lose accuracy [132] @@ -11,8 +11,8 @@ * ptrdiff_t. */ -/* lint1-extra-flags: -a */ /* lint1-only-if: ilp32 int */ +/* lint1-extra-flags: -a -X 351 */ /* * Seen in usr.bin/make/var.c, function RegexReplace, in the function call diff --git a/tests/usr.bin/xlint/lint1/msg_135.c b/tests/usr.bin/xlint/lint1/msg_135.c index 795125921705..917d72731d42 100644 --- a/tests/usr.bin/xlint/lint1/msg_135.c +++ b/tests/usr.bin/xlint/lint1/msg_135.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_135.c,v 1.11 2022/07/16 22:36:06 rillig Exp $ */ +/* $NetBSD: msg_135.c,v 1.12 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_135.c" // Test for message: converting '%s' to '%s' increases alignment from %u to %u [135] -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ void sink(const void *); diff --git a/tests/usr.bin/xlint/lint1/msg_139.c b/tests/usr.bin/xlint/lint1/msg_139.c index 6dfe5bc3e961..a3cf79a76fb0 100644 --- a/tests/usr.bin/xlint/lint1/msg_139.c +++ b/tests/usr.bin/xlint/lint1/msg_139.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_139.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_139.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_139.c" // Test for message: division by 0 [139] +/* lint1-extra-flags: -X 351 */ + void sink_int(int); void sink_double(double); diff --git a/tests/usr.bin/xlint/lint1/msg_141.c b/tests/usr.bin/xlint/lint1/msg_141.c index 13e53485458f..7c68188c7e52 100644 --- a/tests/usr.bin/xlint/lint1/msg_141.c +++ b/tests/usr.bin/xlint/lint1/msg_141.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_141.c,v 1.5 2021/08/23 06:50:01 rillig Exp $ */ +/* $NetBSD: msg_141.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_141.c" // Test for message: integer overflow detected, op '%s' [141] -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ /* * Before tree.c 1.347 from 2021-08-23, lint wrongly warned about integer diff --git a/tests/usr.bin/xlint/lint1/msg_142.c b/tests/usr.bin/xlint/lint1/msg_142.c index 711cdb736db9..e2b2e4364df8 100644 --- a/tests/usr.bin/xlint/lint1/msg_142.c +++ b/tests/usr.bin/xlint/lint1/msg_142.c @@ -1,9 +1,11 @@ -/* $NetBSD: msg_142.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_142.c,v 1.8 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_142.c" // Test for message: floating point overflow on operator '%s' [142] /* lint1-only-if: ldbl-64 */ +/* lint1-extra-flags: -X 351 */ + /* * For 96-bit and 128-bit floating point numbers, a different number of * multipliers is needed to produce an overflow. diff --git a/tests/usr.bin/xlint/lint1/msg_147.c b/tests/usr.bin/xlint/lint1/msg_147.c index a613258be0d4..4dc54f118268 100644 --- a/tests/usr.bin/xlint/lint1/msg_147.c +++ b/tests/usr.bin/xlint/lint1/msg_147.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_147.c,v 1.4 2021/07/25 10:39:10 rillig Exp $ */ +/* $NetBSD: msg_147.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_147.c" // Test for message: invalid cast from '%s' to '%s' [147] +/* lint1-extra-flags: -X 351 */ + // The type name 'int(int)' is a 'function(int) returning int'. void take(int(int)); diff --git a/tests/usr.bin/xlint/lint1/msg_150.c b/tests/usr.bin/xlint/lint1/msg_150.c index 76ce716ec3f5..94b486cbc343 100644 --- a/tests/usr.bin/xlint/lint1/msg_150.c +++ b/tests/usr.bin/xlint/lint1/msg_150.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_150.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_150.c,v 1.6 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_150.c" // Test for message: argument mismatch: %d %s passed, %d expected [150] +/* lint1-extra-flags: -X 351 */ + int add2(int, int); diff --git a/tests/usr.bin/xlint/lint1/msg_151.c b/tests/usr.bin/xlint/lint1/msg_151.c index e5713a4a80b1..5f5d1b722b31 100644 --- a/tests/usr.bin/xlint/lint1/msg_151.c +++ b/tests/usr.bin/xlint/lint1/msg_151.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_151.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_151.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_151.c" // Test for message: void expressions may not be arguments, arg #%d [151] +/* lint1-extra-flags: -X 351 */ + void sink_int(int); void diff --git a/tests/usr.bin/xlint/lint1/msg_152.c b/tests/usr.bin/xlint/lint1/msg_152.c index e9a9087434c8..c2eafce70f40 100644 --- a/tests/usr.bin/xlint/lint1/msg_152.c +++ b/tests/usr.bin/xlint/lint1/msg_152.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_152.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_152.c,v 1.5 2023/03/28 14:44:34 rillig Exp $ */ # 3 "msg_152.c" // Test for message: argument cannot have unknown size, arg #%d [152] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: struct 'incomplete' never defined [233] */ struct incomplete; diff --git a/tests/usr.bin/xlint/lint1/msg_153.c b/tests/usr.bin/xlint/lint1/msg_153.c index 0d62d90008bb..a722c92331c0 100644 --- a/tests/usr.bin/xlint/lint1/msg_153.c +++ b/tests/usr.bin/xlint/lint1/msg_153.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_153.c,v 1.6 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_153.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_153.c" // Test for message: converting '%s' to incompatible '%s' for argument %d [153] +/* lint1-extra-flags: -X 351 */ + typedef double (*unary_operator)(double); diff --git a/tests/usr.bin/xlint/lint1/msg_154.c b/tests/usr.bin/xlint/lint1/msg_154.c index 217c2b433faa..2cf9053021b8 100644 --- a/tests/usr.bin/xlint/lint1/msg_154.c +++ b/tests/usr.bin/xlint/lint1/msg_154.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_154.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_154.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_154.c" // Test for message: illegal combination of %s '%s' and %s '%s', arg #%d [154] +/* lint1-extra-flags: -X 351 */ + void sink_int(int); void diff --git a/tests/usr.bin/xlint/lint1/msg_155.c b/tests/usr.bin/xlint/lint1/msg_155.c index 59c0b71fb7bf..b33aed15c77c 100644 --- a/tests/usr.bin/xlint/lint1/msg_155.c +++ b/tests/usr.bin/xlint/lint1/msg_155.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_155.c,v 1.11 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_155.c,v 1.12 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_155.c" // Test for message: passing '%s' to incompatible '%s', arg #%d [155] +/* lint1-extra-flags: -X 351 */ + void c99_6_7_6_example_a(int); void c99_6_7_6_example_b(int *); diff --git a/tests/usr.bin/xlint/lint1/msg_156.c b/tests/usr.bin/xlint/lint1/msg_156.c index f199fa3ed9dc..2c8df9ba86c7 100644 --- a/tests/usr.bin/xlint/lint1/msg_156.c +++ b/tests/usr.bin/xlint/lint1/msg_156.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_156.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_156.c,v 1.8 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_156.c" // Test for message: function expects '%s', passing '%s' for arg #%d [156] +/* lint1-extra-flags: -X 351 */ + enum color { RED = 1 << 0, GREEN = 1 << 1, diff --git a/tests/usr.bin/xlint/lint1/msg_157.c b/tests/usr.bin/xlint/lint1/msg_157.c index 5ca77da6f2aa..3b9a3452c706 100644 --- a/tests/usr.bin/xlint/lint1/msg_157.c +++ b/tests/usr.bin/xlint/lint1/msg_157.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_157.c,v 1.4 2022/04/19 22:14:30 rillig Exp $ */ +/* $NetBSD: msg_157.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_157.c" /* Test for message: ANSI C treats constant as unsigned [157] */ -/* lint1-flags: -w */ +/* lint1-flags: -w -X 351 */ /* * A rather strange definition for an ARGB color. diff --git a/tests/usr.bin/xlint/lint1/msg_158.c b/tests/usr.bin/xlint/lint1/msg_158.c index 7d1ba0c67c5f..983864f8f881 100644 --- a/tests/usr.bin/xlint/lint1/msg_158.c +++ b/tests/usr.bin/xlint/lint1/msg_158.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_158.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_158.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_158.c" // Test for message: '%s' may be used before set [158] +/* lint1-extra-flags: -X 351 */ + void sink_int(int); void diff --git a/tests/usr.bin/xlint/lint1/msg_160.c b/tests/usr.bin/xlint/lint1/msg_160.c index 4a3e1bd6d282..75396795c700 100644 --- a/tests/usr.bin/xlint/lint1/msg_160.c +++ b/tests/usr.bin/xlint/lint1/msg_160.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_160.c,v 1.9 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_160.c,v 1.10 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_160.c" // Test for message: operator '==' found where '=' was expected [160] -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ _Bool both_equal_or_unequal(int a, int b, int c, int d) diff --git a/tests/usr.bin/xlint/lint1/msg_161.c b/tests/usr.bin/xlint/lint1/msg_161.c index da4d8f117421..ea9cd44c3fe9 100644 --- a/tests/usr.bin/xlint/lint1/msg_161.c +++ b/tests/usr.bin/xlint/lint1/msg_161.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_161.c,v 1.9 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_161.c,v 1.10 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_161.c" // Test for message: constant in conditional context [161] -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ void while_1(void) diff --git a/tests/usr.bin/xlint/lint1/msg_162.c b/tests/usr.bin/xlint/lint1/msg_162.c index 9e079722e2ac..717a02081c4e 100644 --- a/tests/usr.bin/xlint/lint1/msg_162.c +++ b/tests/usr.bin/xlint/lint1/msg_162.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_162.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_162.c,v 1.8 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_162.c" // Test for message: operator '%s' compares '%s' with '%s' [162] -/* lint1-extra-flags: -hp */ +/* lint1-extra-flags: -hp -X 351 */ void left_unsigned(unsigned int ui) diff --git a/tests/usr.bin/xlint/lint1/msg_168.c b/tests/usr.bin/xlint/lint1/msg_168.c index beafba8ddcaa..8d0f0eef3f8f 100644 --- a/tests/usr.bin/xlint/lint1/msg_168.c +++ b/tests/usr.bin/xlint/lint1/msg_168.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_168.c,v 1.9 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_168.c,v 1.10 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_168.c" // Test for message: array subscript cannot be > %d: %ld [168] +/* lint1-extra-flags: -X 351 */ + void print_string(const char *); void print_char(char); diff --git a/tests/usr.bin/xlint/lint1/msg_169.c b/tests/usr.bin/xlint/lint1/msg_169.c index 92045017f8a6..60da15d18eb2 100644 --- a/tests/usr.bin/xlint/lint1/msg_169.c +++ b/tests/usr.bin/xlint/lint1/msg_169.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_169.c,v 1.6 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_169.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_169.c" // Test for message: precedence confusion possible: parenthesize! [169] -/* lint1-flags: -g -h -S -w */ +/* lint1-flags: -g -h -S -w -X 351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_172.c b/tests/usr.bin/xlint/lint1/msg_172.c index 71756c01ddb9..9ad161314bc2 100644 --- a/tests/usr.bin/xlint/lint1/msg_172.c +++ b/tests/usr.bin/xlint/lint1/msg_172.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_172.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_172.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_172.c" // Test for message: too many struct/union initializers [172] +/* lint1-extra-flags: -X 351 */ + struct color { unsigned int red: 8; unsigned int green: 8; diff --git a/tests/usr.bin/xlint/lint1/msg_173.c b/tests/usr.bin/xlint/lint1/msg_173.c index fa600f3d409b..d568d2106eed 100644 --- a/tests/usr.bin/xlint/lint1/msg_173.c +++ b/tests/usr.bin/xlint/lint1/msg_173.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_173.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_173.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_173.c" // Test for message: too many array initializers, expected %d [173] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: too many array initializers, expected 3 [173] */ int arr_limited[3] = { 1, 2, 3, 4 }; int arr_unlimited[] = { 1, 2, 3, 4 }; diff --git a/tests/usr.bin/xlint/lint1/msg_175.c b/tests/usr.bin/xlint/lint1/msg_175.c index 984e33e10a47..bcdcb05af0f0 100644 --- a/tests/usr.bin/xlint/lint1/msg_175.c +++ b/tests/usr.bin/xlint/lint1/msg_175.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_175.c,v 1.5 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_175.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_175.c" // Test for message: initialization of incomplete type '%s' [175] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: struct 'incomplete' never defined [233] */ struct incomplete; diff --git a/tests/usr.bin/xlint/lint1/msg_176.c b/tests/usr.bin/xlint/lint1/msg_176.c index 02f6cb2c8632..51d20199ca2e 100644 --- a/tests/usr.bin/xlint/lint1/msg_176.c +++ b/tests/usr.bin/xlint/lint1/msg_176.c @@ -1,9 +1,11 @@ -/* $NetBSD: msg_176.c,v 1.5 2021/08/26 19:23:25 rillig Exp $ */ +/* $NetBSD: msg_176.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_176.c" // Test for message: invalid initializer type %s [176] /* This message is not used. */ +/* lint1-extra-flags: -X 351 */ + /* * Before init.c 1.161 from 2021-03-28, lint wrongly complained about * initializers with redundant braces. diff --git a/tests/usr.bin/xlint/lint1/msg_177.c b/tests/usr.bin/xlint/lint1/msg_177.c index 9f1243692803..d2ab8d2c1065 100644 --- a/tests/usr.bin/xlint/lint1/msg_177.c +++ b/tests/usr.bin/xlint/lint1/msg_177.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_177.c,v 1.3 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_177.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_177.c" // Test for message: non-constant initializer [177] +/* lint1-extra-flags: -X 351 */ + extern int function(void); static const int not_a_constant = 13; diff --git a/tests/usr.bin/xlint/lint1/msg_178.c b/tests/usr.bin/xlint/lint1/msg_178.c index f5c55d853304..8316bbe0213c 100644 --- a/tests/usr.bin/xlint/lint1/msg_178.c +++ b/tests/usr.bin/xlint/lint1/msg_178.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_178.c,v 1.3 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_178.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_178.c" // Test for message: initializer does not fit [178] +/* lint1-extra-flags: -X 351 */ + char fits = 123; /* expect+1: warning: initializer does not fit [178] */ diff --git a/tests/usr.bin/xlint/lint1/msg_179.c b/tests/usr.bin/xlint/lint1/msg_179.c index 074ef9c8babb..9d0f2a12de19 100644 --- a/tests/usr.bin/xlint/lint1/msg_179.c +++ b/tests/usr.bin/xlint/lint1/msg_179.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_179.c,v 1.4 2021/12/22 00:45:53 rillig Exp $ */ +/* $NetBSD: msg_179.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_179.c" // Test for message: cannot initialize struct/union with no named member [179] +/* lint1-extra-flags: -X 351 */ + struct { unsigned int :0; } no_named_member = { diff --git a/tests/usr.bin/xlint/lint1/msg_180.c b/tests/usr.bin/xlint/lint1/msg_180.c index 72e0ae7e96d9..2bf2d00c0b3a 100644 --- a/tests/usr.bin/xlint/lint1/msg_180.c +++ b/tests/usr.bin/xlint/lint1/msg_180.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_180.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_180.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_180.c" // Test for message: bit-field initializer does not fit [180] +/* lint1-extra-flags: -X 351 */ + struct example { unsigned int a: 5; unsigned int b: 5; diff --git a/tests/usr.bin/xlint/lint1/msg_181.c b/tests/usr.bin/xlint/lint1/msg_181.c index 47285b480cd9..36459fb6bf8b 100644 --- a/tests/usr.bin/xlint/lint1/msg_181.c +++ b/tests/usr.bin/xlint/lint1/msg_181.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_181.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_181.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_181.c" // Test for message: {}-enclosed initializer required [181] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: {}-enclosed initializer required [181] */ struct { int x; } missing_braces = 3; struct { int x; } including_braces = { 3 }; diff --git a/tests/usr.bin/xlint/lint1/msg_185.c b/tests/usr.bin/xlint/lint1/msg_185.c index 5a9f0c6adf2d..8630a9f71412 100644 --- a/tests/usr.bin/xlint/lint1/msg_185.c +++ b/tests/usr.bin/xlint/lint1/msg_185.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_185.c,v 1.6 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_185.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_185.c" // Test for message: cannot initialize '%s' from '%s' [185] +/* lint1-extra-flags: -X 351 */ + typedef struct any { const void *value; } any; diff --git a/tests/usr.bin/xlint/lint1/msg_186.c b/tests/usr.bin/xlint/lint1/msg_186.c index 6d026fb9b74a..78e753e5cc97 100644 --- a/tests/usr.bin/xlint/lint1/msg_186.c +++ b/tests/usr.bin/xlint/lint1/msg_186.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_186.c,v 1.5 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_186.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_186.c" /* Test for message: bit-field initialization is illegal in traditional C [186] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ struct bit_field { unsigned one: 1; diff --git a/tests/usr.bin/xlint/lint1/msg_187.c b/tests/usr.bin/xlint/lint1/msg_187.c index c007cff01a71..16a3e0f262e4 100644 --- a/tests/usr.bin/xlint/lint1/msg_187.c +++ b/tests/usr.bin/xlint/lint1/msg_187.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_187.c,v 1.4 2021/12/21 22:21:11 rillig Exp $ */ +/* $NetBSD: msg_187.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_187.c" // Test for message: string literal too long (%lu) for target array (%lu) [187] +/* lint1-extra-flags: -X 351 */ + char auto_msg[] = "the string length is determined automatically"; /* The terminating null byte is not copied to the array. */ diff --git a/tests/usr.bin/xlint/lint1/msg_188.c b/tests/usr.bin/xlint/lint1/msg_188.c index fc8b3fbf9e46..c2284a5b0e7b 100644 --- a/tests/usr.bin/xlint/lint1/msg_188.c +++ b/tests/usr.bin/xlint/lint1/msg_188.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_188.c,v 1.4 2022/06/16 16:58:36 rillig Exp $ */ +/* $NetBSD: msg_188.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_188.c" /* Test for message: no automatic aggregate initialization in traditional C [188] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ struct point { int x; diff --git a/tests/usr.bin/xlint/lint1/msg_190.c b/tests/usr.bin/xlint/lint1/msg_190.c index 0079a8e8b75d..5045ebe9c102 100644 --- a/tests/usr.bin/xlint/lint1/msg_190.c +++ b/tests/usr.bin/xlint/lint1/msg_190.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_190.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_190.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_190.c" // Test for message: empty array declaration for '%s' [190] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: empty array declaration for 'empty_array' [190] */ double empty_array[] = {}; diff --git a/tests/usr.bin/xlint/lint1/msg_193.c b/tests/usr.bin/xlint/lint1/msg_193.c index 1d94e09f1b77..df223fd6d057 100644 --- a/tests/usr.bin/xlint/lint1/msg_193.c +++ b/tests/usr.bin/xlint/lint1/msg_193.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_193.c,v 1.20 2023/02/21 19:47:21 rillig Exp $ */ +/* $NetBSD: msg_193.c,v 1.21 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_193.c" // Test for message: statement not reached [193] +/* lint1-extra-flags: -X 351 */ + /* * Test the reachability of statements in a function. * diff --git a/tests/usr.bin/xlint/lint1/msg_204.c b/tests/usr.bin/xlint/lint1/msg_204.c index 9dd6830526c1..10e7d0fa828c 100644 --- a/tests/usr.bin/xlint/lint1/msg_204.c +++ b/tests/usr.bin/xlint/lint1/msg_204.c @@ -1,10 +1,10 @@ -/* $NetBSD: msg_204.c,v 1.7 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_204.c,v 1.8 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_204.c" // Test for message: controlling expressions must have scalar type [204] -/* Suppress message "argument '%s' unused in function '%s'". */ -/* lint1-extra-flags: -X 231 */ +/* Suppress messages for unused arguments and for 'extern' declarations. */ +/* lint1-extra-flags: -X 231 -X 351 */ extern void extern_function(void); diff --git a/tests/usr.bin/xlint/lint1/msg_210.c b/tests/usr.bin/xlint/lint1/msg_210.c index 7d67479db412..f0ce2d688d21 100644 --- a/tests/usr.bin/xlint/lint1/msg_210.c +++ b/tests/usr.bin/xlint/lint1/msg_210.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_210.c,v 1.6 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_210.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_210.c" // Test for message: enum type mismatch between '%s' and '%s' in initialization [210] +/* lint1-extra-flags: -X 351 */ + enum A { A1 }; diff --git a/tests/usr.bin/xlint/lint1/msg_212.c b/tests/usr.bin/xlint/lint1/msg_212.c index 615f63becb90..6a73931ea256 100644 --- a/tests/usr.bin/xlint/lint1/msg_212.c +++ b/tests/usr.bin/xlint/lint1/msg_212.c @@ -1,7 +1,7 @@ -/* $NetBSD: msg_212.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_212.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_212.c" // Test for message: cannot return incomplete type [212] // This message is not used. -int dummy; +typedef int dummy; diff --git a/tests/usr.bin/xlint/lint1/msg_218.c b/tests/usr.bin/xlint/lint1/msg_218.c index 4d52802b1de0..2772e5da7f88 100644 --- a/tests/usr.bin/xlint/lint1/msg_218.c +++ b/tests/usr.bin/xlint/lint1/msg_218.c @@ -1,9 +1,10 @@ -/* $NetBSD: msg_218.c,v 1.6 2023/02/19 12:00:15 rillig Exp $ */ +/* $NetBSD: msg_218.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_218.c" // Test for message: ANSI C treats constant as unsigned, op '%s' [218] /* lint1-only-if: ilp32 */ +/* lint1-extra-flags: -X 351 */ _Bool cond; signed int s32; diff --git a/tests/usr.bin/xlint/lint1/msg_219.c b/tests/usr.bin/xlint/lint1/msg_219.c index 7e304c799f9e..aaef3490ec16 100644 --- a/tests/usr.bin/xlint/lint1/msg_219.c +++ b/tests/usr.bin/xlint/lint1/msg_219.c @@ -1,10 +1,10 @@ -/* $NetBSD: msg_219.c,v 1.5 2022/02/27 19:32:51 rillig Exp $ */ +/* $NetBSD: msg_219.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_219.c" /* Test for message: concatenated strings are illegal in traditional C [219] */ -/* lint1-flags: -t -w */ +/* lint1-flags: -t -w -X 351 */ char concat1[] = "one"; /* expect+1: warning: concatenated strings are illegal in traditional C [219] */ diff --git a/tests/usr.bin/xlint/lint1/msg_220.c b/tests/usr.bin/xlint/lint1/msg_220.c index b73316357f51..a22af928fdb1 100644 --- a/tests/usr.bin/xlint/lint1/msg_220.c +++ b/tests/usr.bin/xlint/lint1/msg_220.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_220.c,v 1.8 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_220.c,v 1.9 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_220.c" // Test for message: fallthrough on case statement [220] -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ extern void println(const char *); diff --git a/tests/usr.bin/xlint/lint1/msg_221.c b/tests/usr.bin/xlint/lint1/msg_221.c index db3d73e70f7a..fa1d7593c9e9 100644 --- a/tests/usr.bin/xlint/lint1/msg_221.c +++ b/tests/usr.bin/xlint/lint1/msg_221.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_221.c,v 1.5 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_221.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_221.c" // Test for message: initialization of unsigned with negative constant [221] +/* lint1-extra-flags: -X 351 */ + struct example { unsigned int a: 5; unsigned int b: 5; diff --git a/tests/usr.bin/xlint/lint1/msg_222.c b/tests/usr.bin/xlint/lint1/msg_222.c index 92f307f28dce..8aee43b13ece 100644 --- a/tests/usr.bin/xlint/lint1/msg_222.c +++ b/tests/usr.bin/xlint/lint1/msg_222.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_222.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_222.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_222.c" // Test for message: conversion of negative constant to unsigned type [222] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: initialization of unsigned with negative constant [221] */ unsigned int global = -1; diff --git a/tests/usr.bin/xlint/lint1/msg_238.c b/tests/usr.bin/xlint/lint1/msg_238.c index e79d0bc9856e..99bad647a154 100644 --- a/tests/usr.bin/xlint/lint1/msg_238.c +++ b/tests/usr.bin/xlint/lint1/msg_238.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_238.c,v 1.5 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_238.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_238.c" /* Test for message: initialization of union is illegal in traditional C [238] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ struct { int x; diff --git a/tests/usr.bin/xlint/lint1/msg_241.c b/tests/usr.bin/xlint/lint1/msg_241.c index 83476c38eb4e..356a76bd75ec 100644 --- a/tests/usr.bin/xlint/lint1/msg_241.c +++ b/tests/usr.bin/xlint/lint1/msg_241.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_241.c,v 1.9 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_241.c,v 1.10 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_241.c" // Test for message: dubious operation on enum, op '%s' [241] @@ -7,7 +7,7 @@ // share/mk/sys.mk, therefore this message is neither well-known nor // well-tested. -/* lint1-extra-flags: -e */ +/* lint1-extra-flags: -e -X 351 */ /* * Enums are a possible implementation of bit-sets. diff --git a/tests/usr.bin/xlint/lint1/msg_242.c b/tests/usr.bin/xlint/lint1/msg_242.c index 8ccaa31f7932..74d48b373c12 100644 --- a/tests/usr.bin/xlint/lint1/msg_242.c +++ b/tests/usr.bin/xlint/lint1/msg_242.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_242.c,v 1.6 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_242.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_242.c" // Test for message: combination of '%s' and '%s', op '%s' [242] -/* lint1-extra-flags: -e */ +/* lint1-extra-flags: -e -X 351 */ enum E { E1 diff --git a/tests/usr.bin/xlint/lint1/msg_243.c b/tests/usr.bin/xlint/lint1/msg_243.c index dce191e99f85..41a6e21d9670 100644 --- a/tests/usr.bin/xlint/lint1/msg_243.c +++ b/tests/usr.bin/xlint/lint1/msg_243.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_243.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_243.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_243.c" // Test for message: dubious comparison of enums, op '%s' [243] -/* lint1-extra-flags: -eP */ +/* lint1-extra-flags: -eP -X 351 */ enum color { RED, GREEN, BLUE diff --git a/tests/usr.bin/xlint/lint1/msg_245.c b/tests/usr.bin/xlint/lint1/msg_245.c index 5a33c3b0936f..cfc8e3399a86 100644 --- a/tests/usr.bin/xlint/lint1/msg_245.c +++ b/tests/usr.bin/xlint/lint1/msg_245.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_245.c,v 1.5 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_245.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_245.c" // Test for message: incompatible structure pointers: '%s' '%s' '%s' [245] +/* lint1-extra-flags: -X 351 */ + typedef struct tag_and_typedef_tag { int member; } tag_and_typedef_typedef; diff --git a/tests/usr.bin/xlint/lint1/msg_247.c b/tests/usr.bin/xlint/lint1/msg_247.c index 1fea109afe98..2fe7d61b0014 100644 --- a/tests/usr.bin/xlint/lint1/msg_247.c +++ b/tests/usr.bin/xlint/lint1/msg_247.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_247.c,v 1.26 2022/06/24 21:22:11 rillig Exp $ */ +/* $NetBSD: msg_247.c,v 1.27 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_247.c" // Test for message: pointer cast from '%s' to '%s' may be troublesome [247] -/* lint1-extra-flags: -c */ +/* lint1-extra-flags: -c -X 351 */ /* example taken from Xlib.h */ typedef struct { diff --git a/tests/usr.bin/xlint/lint1/msg_248.c b/tests/usr.bin/xlint/lint1/msg_248.c index b392672945da..042c6e69a4af 100644 --- a/tests/usr.bin/xlint/lint1/msg_248.c +++ b/tests/usr.bin/xlint/lint1/msg_248.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_248.c,v 1.4 2023/01/21 17:48:29 rillig Exp $ */ +/* $NetBSD: msg_248.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_248.c" // Test for message: floating-point constant out of range [248] +/* lint1-extra-flags: -X 351 */ + float fits_flt = 1e37f; /* expect+1: warning: floating-point constant out of range [248] */ float too_large_flt = 1e40f; diff --git a/tests/usr.bin/xlint/lint1/msg_249.c b/tests/usr.bin/xlint/lint1/msg_249.c index 311665db050a..09c51e7fa211 100644 --- a/tests/usr.bin/xlint/lint1/msg_249.c +++ b/tests/usr.bin/xlint/lint1/msg_249.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_249.c,v 1.13 2023/01/29 18:37:20 rillig Exp $ */ +/* $NetBSD: msg_249.c,v 1.14 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_249.c" // Test for message: syntax error '%s' [249] +/* lint1-extra-flags: -X 351 */ + /* * Cover the grammar rule 'top_level_declaration: error T_SEMI'. */ diff --git a/tests/usr.bin/xlint/lint1/msg_251.c b/tests/usr.bin/xlint/lint1/msg_251.c index 24a15ab69046..4e1b7839cf22 100644 --- a/tests/usr.bin/xlint/lint1/msg_251.c +++ b/tests/usr.bin/xlint/lint1/msg_251.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_251.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_251.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_251.c" // Test for message: malformed integer constant [251] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: malformed integer constant [251] */ int lll = 123LLL; diff --git a/tests/usr.bin/xlint/lint1/msg_252.c b/tests/usr.bin/xlint/lint1/msg_252.c index 32d4a5273042..d3b73ae7c8bc 100644 --- a/tests/usr.bin/xlint/lint1/msg_252.c +++ b/tests/usr.bin/xlint/lint1/msg_252.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_252.c,v 1.4 2021/08/28 18:40:15 rillig Exp $ */ +/* $NetBSD: msg_252.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_252.c" // Test for message: integer constant out of range [252] @@ -25,5 +25,7 @@ */ /* lint1-skip-if: ilp32 */ +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: integer constant out of range [252] */ int constant = 1111111111111111111111111111111111111111111111111111; diff --git a/tests/usr.bin/xlint/lint1/msg_255.c b/tests/usr.bin/xlint/lint1/msg_255.c index 71b25eeb8cd2..574e2c8c4397 100644 --- a/tests/usr.bin/xlint/lint1/msg_255.c +++ b/tests/usr.bin/xlint/lint1/msg_255.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_255.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_255.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_255.c" // Test for message: undefined or invalid # directive [255] +/* lint1-extra-flags: -X 351 */ + #pragma once /* expect+1: warning: undefined or invalid # directive [255] */ diff --git a/tests/usr.bin/xlint/lint1/msg_256.c b/tests/usr.bin/xlint/lint1/msg_256.c index 5a5060308cc7..638b57a68ee1 100644 --- a/tests/usr.bin/xlint/lint1/msg_256.c +++ b/tests/usr.bin/xlint/lint1/msg_256.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_256.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_256.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_256.c" // Test for message: unterminated comment [256] -int dummy; +typedef int dummy; /* expect+2: error: unterminated comment [256] */ /* This comment never ends. diff --git a/tests/usr.bin/xlint/lint1/msg_257.c b/tests/usr.bin/xlint/lint1/msg_257.c index 4c06aa74b38b..912906776438 100644 --- a/tests/usr.bin/xlint/lint1/msg_257.c +++ b/tests/usr.bin/xlint/lint1/msg_257.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_257.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_257.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_257.c" // Test for message: extra characters in lint comment [257] +/* lint1-extra-flags: -X 351 */ + void take(const void *); /* expect+1: warning: extra characters in lint comment [257] */ diff --git a/tests/usr.bin/xlint/lint1/msg_258.c b/tests/usr.bin/xlint/lint1/msg_258.c index 0b7b69ec01ef..fd48500d5a3b 100644 --- a/tests/usr.bin/xlint/lint1/msg_258.c +++ b/tests/usr.bin/xlint/lint1/msg_258.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_258.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_258.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_258.c" // Test for message: unterminated string constant [258] +/* lint1-extra-flags: -X 351 */ + int dummy; // A string literal that is not finished at the end of the line confuses the diff --git a/tests/usr.bin/xlint/lint1/msg_259.c b/tests/usr.bin/xlint/lint1/msg_259.c index e589167c7e9a..4f7faf0f117e 100644 --- a/tests/usr.bin/xlint/lint1/msg_259.c +++ b/tests/usr.bin/xlint/lint1/msg_259.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_259.c,v 1.21 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_259.c,v 1.22 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_259.c" // Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] @@ -20,7 +20,7 @@ */ /* lint1-only-if: lp64 */ -/* lint1-flags: -g -h -w */ +/* lint1-flags: -g -h -w -X 351 */ void plain_char(char); void signed_char(signed char); diff --git a/tests/usr.bin/xlint/lint1/msg_259_c90.c b/tests/usr.bin/xlint/lint1/msg_259_c90.c index e0734e3b58c5..e45afd663ce2 100644 --- a/tests/usr.bin/xlint/lint1/msg_259_c90.c +++ b/tests/usr.bin/xlint/lint1/msg_259_c90.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_259_c90.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_259_c90.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_259_c90.c" /* Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] */ @@ -20,7 +20,7 @@ */ /* lint1-only-if: lp64 */ -/* lint1-flags: -h -w */ +/* lint1-flags: -h -w -X 351 */ void plain_char(char); void signed_char(signed char); diff --git a/tests/usr.bin/xlint/lint1/msg_259_ilp32.c b/tests/usr.bin/xlint/lint1/msg_259_ilp32.c index b5f2642efa0d..d35f40870791 100644 --- a/tests/usr.bin/xlint/lint1/msg_259_ilp32.c +++ b/tests/usr.bin/xlint/lint1/msg_259_ilp32.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_259_ilp32.c,v 1.8 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_259_ilp32.c,v 1.9 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_259_ilp32.c" /* Test for message: argument #%d is converted from '%s' to '%s' due to prototype [259] */ @@ -11,7 +11,7 @@ */ /* lint1-only-if: ilp32 */ -/* lint1-flags: -h -w */ +/* lint1-flags: -h -w -X 351 */ void plain_char(char); void signed_int(int); diff --git a/tests/usr.bin/xlint/lint1/msg_262.c b/tests/usr.bin/xlint/lint1/msg_262.c index c56654a5e7eb..af5b88f5b617 100644 --- a/tests/usr.bin/xlint/lint1/msg_262.c +++ b/tests/usr.bin/xlint/lint1/msg_262.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_262.c,v 1.4 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_262.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_262.c" /* Test for message: \" inside character constants undefined in traditional C [262] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ /* expect+1: warning: \" inside character constants undefined in traditional C [262] */ char msg = '\"'; diff --git a/tests/usr.bin/xlint/lint1/msg_263.c b/tests/usr.bin/xlint/lint1/msg_263.c index 9fbb87e44ee3..c8516cb2d4a7 100644 --- a/tests/usr.bin/xlint/lint1/msg_263.c +++ b/tests/usr.bin/xlint/lint1/msg_263.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_263.c,v 1.4 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_263.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_263.c" /* Test for message: \? undefined in traditional C [263] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ /* expect+1: warning: \? undefined in traditional C [263] */ char ch = '\?'; diff --git a/tests/usr.bin/xlint/lint1/msg_264.c b/tests/usr.bin/xlint/lint1/msg_264.c index 84f902aa4578..e19d89a08d03 100644 --- a/tests/usr.bin/xlint/lint1/msg_264.c +++ b/tests/usr.bin/xlint/lint1/msg_264.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_264.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_264.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_264.c" /* Test for message: \v undefined in traditional C [264] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ /* expect+1: warning: \v undefined in traditional C [264] */ char str[] = "vertical \v tab"; diff --git a/tests/usr.bin/xlint/lint1/msg_265.c b/tests/usr.bin/xlint/lint1/msg_265.c index 76eb29eb5224..5e144cf6b8db 100644 --- a/tests/usr.bin/xlint/lint1/msg_265.c +++ b/tests/usr.bin/xlint/lint1/msg_265.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_265.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_265.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_265.c" /* Test for message: %s does not support 'long long' [265] */ -/* lint1-flags: -w */ +/* lint1-flags: -w -X 351 */ /* expect+1: warning: C90 does not support 'long long' [265] */ long long unsupported_variable; diff --git a/tests/usr.bin/xlint/lint1/msg_266.c b/tests/usr.bin/xlint/lint1/msg_266.c index 07ad67f6b1dd..60140b1d2448 100644 --- a/tests/usr.bin/xlint/lint1/msg_266.c +++ b/tests/usr.bin/xlint/lint1/msg_266.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_266.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_266.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_266.c" /* Test for message: 'long double' is illegal in traditional C [266] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ /* expect+1: warning: 'long double' is illegal in traditional C [266] */ long double ldbl = 0.0; diff --git a/tests/usr.bin/xlint/lint1/msg_269.c b/tests/usr.bin/xlint/lint1/msg_269.c index 9a1c2a074c02..9b07492a1957 100644 --- a/tests/usr.bin/xlint/lint1/msg_269.c +++ b/tests/usr.bin/xlint/lint1/msg_269.c @@ -1,7 +1,9 @@ -/* $NetBSD: msg_269.c,v 1.4 2022/06/11 11:52:13 rillig Exp $ */ +/* $NetBSD: msg_269.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_269.c" // Test for message: argument '%s' declared inline [269] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: argument 'x' declared inline [269] */ void example(inline int x); diff --git a/tests/usr.bin/xlint/lint1/msg_270.c b/tests/usr.bin/xlint/lint1/msg_270.c index 1ba809683a90..a59ad14ebe14 100644 --- a/tests/usr.bin/xlint/lint1/msg_270.c +++ b/tests/usr.bin/xlint/lint1/msg_270.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_270.c,v 1.3 2021/08/22 13:45:56 rillig Exp $ */ +/* $NetBSD: msg_270.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_270.c" /* Test for message: function prototypes are illegal in traditional C [270] */ -/* lint1-flags: -tw */ +/* lint1-flags: -tw -X 351 */ /* expect+1: warning: function prototypes are illegal in traditional C [270] */ void prototype(void); diff --git a/tests/usr.bin/xlint/lint1/msg_276.c b/tests/usr.bin/xlint/lint1/msg_276.c index c1b9e2f98318..41233feb6e96 100644 --- a/tests/usr.bin/xlint/lint1/msg_276.c +++ b/tests/usr.bin/xlint/lint1/msg_276.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_276.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_276.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_276.c" // Test for message: '__%s__' is illegal for type '%s' [276] +/* lint1-extra-flags: -X 351 */ + /* expect+1: error: '__real__' is illegal for type 'double' [276] */ int real_int = __real__ 0.0; /* expect+1: error: '__imag__' is illegal for type 'double' [276] */ diff --git a/tests/usr.bin/xlint/lint1/msg_277.c b/tests/usr.bin/xlint/lint1/msg_277.c index 596e1c17b976..9ef7d2a8c335 100644 --- a/tests/usr.bin/xlint/lint1/msg_277.c +++ b/tests/usr.bin/xlint/lint1/msg_277.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_277.c,v 1.6 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_277.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_277.c" // Test for message: initialization of '%s' with '%s' [277] -/* lint1-extra-flags: -e */ +/* lint1-extra-flags: -e -X 351 */ enum E { E1 diff --git a/tests/usr.bin/xlint/lint1/msg_278.c b/tests/usr.bin/xlint/lint1/msg_278.c index 07a6fbc0cb1b..f6a833f0dc5f 100644 --- a/tests/usr.bin/xlint/lint1/msg_278.c +++ b/tests/usr.bin/xlint/lint1/msg_278.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_278.c,v 1.4 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_278.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_278.c" // Test for message: combination of '%s' and '%s', arg #%d [278] -/* lint1-extra-flags: -e */ +/* lint1-extra-flags: -e -X 351 */ enum E { E1 diff --git a/tests/usr.bin/xlint/lint1/msg_279.c b/tests/usr.bin/xlint/lint1/msg_279.c index ec5626c85c44..67ea20d328e5 100644 --- a/tests/usr.bin/xlint/lint1/msg_279.c +++ b/tests/usr.bin/xlint/lint1/msg_279.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_279.c,v 1.4 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_279.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_279.c" // Test for message: combination of '%s' and '%s' in return [279] -/* lint1-extra-flags: -e */ +/* lint1-extra-flags: -e -X 351 */ enum E { E1 diff --git a/tests/usr.bin/xlint/lint1/msg_282.c b/tests/usr.bin/xlint/lint1/msg_282.c index 0948614b0955..cf8efca270f8 100644 --- a/tests/usr.bin/xlint/lint1/msg_282.c +++ b/tests/usr.bin/xlint/lint1/msg_282.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_282.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_282.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_282.c" // Test for message: comment /* %s */ must precede function definition [282] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: comment ** ARGSUSED ** must precede function definition [282] */ /* ARGSUSED */ int argsused; diff --git a/tests/usr.bin/xlint/lint1/msg_284.c b/tests/usr.bin/xlint/lint1/msg_284.c index 78a1217911e8..8adfa6b71865 100644 --- a/tests/usr.bin/xlint/lint1/msg_284.c +++ b/tests/usr.bin/xlint/lint1/msg_284.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_284.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_284.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_284.c" // Test for message: fallthrough on default statement [284] -/* lint1-extra-flags: -h */ +/* lint1-extra-flags: -h -X 351 */ void print_int(int); diff --git a/tests/usr.bin/xlint/lint1/msg_285.c b/tests/usr.bin/xlint/lint1/msg_285.c index cc37529a76ea..91c0327897d4 100644 --- a/tests/usr.bin/xlint/lint1/msg_285.c +++ b/tests/usr.bin/xlint/lint1/msg_285.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_285.c,v 1.4 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_285.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_285.c" // Test for message: prototype declaration [285] -/* lint1-extra-flags: -r */ +/* lint1-extra-flags: -r -X 351 */ /* expect+1: prototype declaration [285] */ void function(int, int, int); diff --git a/tests/usr.bin/xlint/lint1/msg_291.c b/tests/usr.bin/xlint/lint1/msg_291.c index 2a336c5ac3c9..7c28827e1635 100644 --- a/tests/usr.bin/xlint/lint1/msg_291.c +++ b/tests/usr.bin/xlint/lint1/msg_291.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_291.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_291.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_291.c" // Test for message: invalid multibyte character [291] +/* lint1-extra-flags: -X 351 */ + char foreign[] = "\x80\xC3\x76"; /* expect+1: error: syntax error ':' [249] */ diff --git a/tests/usr.bin/xlint/lint1/msg_292.c b/tests/usr.bin/xlint/lint1/msg_292.c index c91d4a5a262d..1eb5798b4b8c 100644 --- a/tests/usr.bin/xlint/lint1/msg_292.c +++ b/tests/usr.bin/xlint/lint1/msg_292.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_292.c,v 1.4 2022/02/27 19:32:51 rillig Exp $ */ +/* $NetBSD: msg_292.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_292.c" // Test for message: cannot concatenate wide and regular string literals [292] +/* lint1-extra-flags: -X 351 */ + const char c_c_c_w_w_w[] = "c2" "c 4" diff --git a/tests/usr.bin/xlint/lint1/msg_294.c b/tests/usr.bin/xlint/lint1/msg_294.c index e37cb3869eb2..46c109eaca91 100644 --- a/tests/usr.bin/xlint/lint1/msg_294.c +++ b/tests/usr.bin/xlint/lint1/msg_294.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_294.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_294.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_294.c" // Test for message: multi-character character constant [294] +/* lint1-extra-flags: -X 351 */ + /* expect+2: warning: multi-character character constant [294] */ /* expect+1: warning: initializer does not fit [178] */ char ch = '1234'; diff --git a/tests/usr.bin/xlint/lint1/msg_296.c b/tests/usr.bin/xlint/lint1/msg_296.c index f0c647809037..aa279ed4db9f 100644 --- a/tests/usr.bin/xlint/lint1/msg_296.c +++ b/tests/usr.bin/xlint/lint1/msg_296.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_296.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_296.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_296.c" // Test for message: conversion of negative constant to unsigned type, arg #%d [296] +/* lint1-extra-flags: -X 351 */ + void take_unsigned_int(unsigned int); void diff --git a/tests/usr.bin/xlint/lint1/msg_297.c b/tests/usr.bin/xlint/lint1/msg_297.c index c663a8514c4c..7ec869273ca8 100644 --- a/tests/usr.bin/xlint/lint1/msg_297.c +++ b/tests/usr.bin/xlint/lint1/msg_297.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_297.c,v 1.3 2021/08/27 20:49:25 rillig Exp $ */ +/* $NetBSD: msg_297.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_297.c" // Test for message: conversion to '%s' may sign-extend incorrectly, arg #%d [297] -/* lint1-extra-flags: -P -a -p */ +/* lint1-extra-flags: -P -a -p -X 351 */ void take_unsigned_long_long(unsigned long long); void take_long_long(long long); diff --git a/tests/usr.bin/xlint/lint1/msg_298.c b/tests/usr.bin/xlint/lint1/msg_298.c index cf7f14cbda8b..32893ee7320e 100644 --- a/tests/usr.bin/xlint/lint1/msg_298.c +++ b/tests/usr.bin/xlint/lint1/msg_298.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_298.c,v 1.4 2022/04/19 20:08:52 rillig Exp $ */ +/* $NetBSD: msg_298.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_298.c" // Test for message: conversion from '%s' to '%s' may lose accuracy, arg #%d [298] -/* lint1-extra-flags: -a */ +/* lint1-extra-flags: -a -X 351 */ void take_uchar(unsigned char); void take_schar(signed char); diff --git a/tests/usr.bin/xlint/lint1/msg_301.c b/tests/usr.bin/xlint/lint1/msg_301.c index 0eec3b6977ba..63dd4d67e073 100644 --- a/tests/usr.bin/xlint/lint1/msg_301.c +++ b/tests/usr.bin/xlint/lint1/msg_301.c @@ -1,10 +1,12 @@ -/* $NetBSD: msg_301.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_301.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_301.c" // Test for message: array of incomplete type [301] // This message is not used. // TODO: This message occurs in the code but is deactivated. +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: struct 'incomplete' never defined [233] */ struct incomplete; diff --git a/tests/usr.bin/xlint/lint1/msg_303.c b/tests/usr.bin/xlint/lint1/msg_303.c index 0dc6955d56f2..9ca01fb80d53 100644 --- a/tests/usr.bin/xlint/lint1/msg_303.c +++ b/tests/usr.bin/xlint/lint1/msg_303.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_303.c,v 1.3 2021/08/16 18:51:58 rillig Exp $ */ +/* $NetBSD: msg_303.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_303.c" /* Test for message: ANSI C forbids conversion of %s to %s [303] */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ void take_void_pointer(void *); diff --git a/tests/usr.bin/xlint/lint1/msg_304.c b/tests/usr.bin/xlint/lint1/msg_304.c index a75ea010cb54..5d6861482884 100644 --- a/tests/usr.bin/xlint/lint1/msg_304.c +++ b/tests/usr.bin/xlint/lint1/msg_304.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_304.c,v 1.3 2021/08/16 18:51:58 rillig Exp $ */ +/* $NetBSD: msg_304.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_304.c" /* Test for message: ANSI C forbids conversion of %s to %s, arg #%d [304] */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ void take_void_pointer(void *); void take_function_pointer(void (*)(void)); diff --git a/tests/usr.bin/xlint/lint1/msg_305.c b/tests/usr.bin/xlint/lint1/msg_305.c index 28c79f140cfd..8a4d49c50236 100644 --- a/tests/usr.bin/xlint/lint1/msg_305.c +++ b/tests/usr.bin/xlint/lint1/msg_305.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_305.c,v 1.3 2021/08/16 18:51:58 rillig Exp $ */ +/* $NetBSD: msg_305.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_305.c" /* Test for message: ANSI C forbids conversion of %s to %s, op %s [305] */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ void take_void_pointer(void *); diff --git a/tests/usr.bin/xlint/lint1/msg_308.c b/tests/usr.bin/xlint/lint1/msg_308.c index 8213337db534..d78e861ff0ab 100644 --- a/tests/usr.bin/xlint/lint1/msg_308.c +++ b/tests/usr.bin/xlint/lint1/msg_308.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_308.c,v 1.7 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_308.c,v 1.8 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_308.c" // Test for message: invalid type for _Complex [308] +/* lint1-extra-flags: -X 351 */ + float _Complex float_complex; double _Complex double_complex; long double _Complex long_double_complex; diff --git a/tests/usr.bin/xlint/lint1/msg_313.c b/tests/usr.bin/xlint/lint1/msg_313.c index ffb0b9f180a3..581ea8c03100 100644 --- a/tests/usr.bin/xlint/lint1/msg_313.c +++ b/tests/usr.bin/xlint/lint1/msg_313.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_313.c,v 1.4 2022/02/27 12:00:27 rillig Exp $ */ +/* $NetBSD: msg_313.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_313.c" /* Test for message: struct or union member name in initializer is a C99 feature [313] */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ struct point { int x, y; diff --git a/tests/usr.bin/xlint/lint1/msg_315.c b/tests/usr.bin/xlint/lint1/msg_315.c index 91a74c3ab90b..ffd9936fe5b2 100644 --- a/tests/usr.bin/xlint/lint1/msg_315.c +++ b/tests/usr.bin/xlint/lint1/msg_315.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_315.c,v 1.3 2022/02/27 12:00:27 rillig Exp $ */ +/* $NetBSD: msg_315.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_315.c" // Test for message: GCC style struct or union member name in initializer [315] -/* lint1-flags: -Sw */ +/* lint1-flags: -Sw -X 351 */ struct point { int x, y; diff --git a/tests/usr.bin/xlint/lint1/msg_316.c b/tests/usr.bin/xlint/lint1/msg_316.c index 01ce62648e4f..81464b6ec0f9 100644 --- a/tests/usr.bin/xlint/lint1/msg_316.c +++ b/tests/usr.bin/xlint/lint1/msg_316.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_316.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_316.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_316.c" // Test for message: __FUNCTION__/__PRETTY_FUNCTION__ is a GCC extension [316] -/* lint1-flags: -Sw */ +/* lint1-flags: -Sw -X 351 */ void println(const char *); diff --git a/tests/usr.bin/xlint/lint1/msg_319.c b/tests/usr.bin/xlint/lint1/msg_319.c index 447b7e756e38..9db35fec9de8 100644 --- a/tests/usr.bin/xlint/lint1/msg_319.c +++ b/tests/usr.bin/xlint/lint1/msg_319.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_319.c,v 1.4 2022/02/27 12:00:27 rillig Exp $ */ +/* $NetBSD: msg_319.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_319.c" /* Test for message: compound literals are a C99/GCC extension [319] */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ /* expect+2: error: compound literals are a C99/GCC extension [319] */ /* expect+1: error: non-constant initializer [177] */ diff --git a/tests/usr.bin/xlint/lint1/msg_321.c b/tests/usr.bin/xlint/lint1/msg_321.c index c802afb66f7c..97ef9351ac48 100644 --- a/tests/usr.bin/xlint/lint1/msg_321.c +++ b/tests/usr.bin/xlint/lint1/msg_321.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_321.c,v 1.4 2022/02/27 12:00:27 rillig Exp $ */ +/* $NetBSD: msg_321.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_321.c" /* Test for message: array initializer with designators is a C99 feature [321] */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ int vector[3] = { /* expect+1: warning: array initializer with designators is a C99 feature [321] */ diff --git a/tests/usr.bin/xlint/lint1/msg_323.c b/tests/usr.bin/xlint/lint1/msg_323.c index 4f4b3075ef13..ff8be370c465 100644 --- a/tests/usr.bin/xlint/lint1/msg_323.c +++ b/tests/usr.bin/xlint/lint1/msg_323.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_323.c,v 1.4 2021/10/10 09:17:24 rillig Exp $ */ +/* $NetBSD: msg_323.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_323.c" // Test for message: continue in 'do ... while (0)' loop [323] +/* lint1-extra-flags: -X 351 */ + void println(const char *); /* diff --git a/tests/usr.bin/xlint/lint1/msg_325.c b/tests/usr.bin/xlint/lint1/msg_325.c index e1951491f255..5e5ff01baf5d 100644 --- a/tests/usr.bin/xlint/lint1/msg_325.c +++ b/tests/usr.bin/xlint/lint1/msg_325.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_325.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_325.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_325.c" /* Test for message: variable declaration in for loop [325] */ -/* lint1-flags: -sw */ +/* lint1-flags: -sw -X 351 */ int printf(const char *, ...); diff --git a/tests/usr.bin/xlint/lint1/msg_326.c b/tests/usr.bin/xlint/lint1/msg_326.c index 7b0e11f8a35a..92255d9bc123 100644 --- a/tests/usr.bin/xlint/lint1/msg_326.c +++ b/tests/usr.bin/xlint/lint1/msg_326.c @@ -1,7 +1,9 @@ -/* $NetBSD: msg_326.c,v 1.4 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_326.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_326.c" // Test for message: attribute '%s' ignored for '%s' [326] +/* lint1-extra-flags: -X 351 */ + /* expect+1: warning: attribute 'packed' ignored for 'int' [326] */ int variable __packed; diff --git a/tests/usr.bin/xlint/lint1/msg_327.c b/tests/usr.bin/xlint/lint1/msg_327.c index 2fa4acc6fb07..3e69cf50749b 100644 --- a/tests/usr.bin/xlint/lint1/msg_327.c +++ b/tests/usr.bin/xlint/lint1/msg_327.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_327.c,v 1.6 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_327.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_327.c" /* Test for message: declarations after statements is a C99 feature [327] */ -/* lint1-flags: -w */ +/* lint1-flags: -w -X 351 */ void statement(void); diff --git a/tests/usr.bin/xlint/lint1/msg_330.c b/tests/usr.bin/xlint/lint1/msg_330.c index 7aeb7ff07269..618974482a39 100644 --- a/tests/usr.bin/xlint/lint1/msg_330.c +++ b/tests/usr.bin/xlint/lint1/msg_330.c @@ -1,11 +1,11 @@ -/* $NetBSD: msg_330.c,v 1.5 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_330.c,v 1.6 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_330.c" // Test for message: operand of '%s' must be bool, not '%s' [330] // // See d_c99_bool_strict.c for many more examples. -/* lint1-extra-flags: -T */ +/* lint1-extra-flags: -T -X 351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_331.c b/tests/usr.bin/xlint/lint1/msg_331.c index 88a9d4e2711d..bd21007585b7 100644 --- a/tests/usr.bin/xlint/lint1/msg_331.c +++ b/tests/usr.bin/xlint/lint1/msg_331.c @@ -1,11 +1,11 @@ -/* $NetBSD: msg_331.c,v 1.4 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_331.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_331.c" // Test for message: left operand of '%s' must be bool, not '%s' [331] // // See d_c99_bool_strict.c for many more examples. -/* lint1-extra-flags: -T */ +/* lint1-extra-flags: -T -X 351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_332.c b/tests/usr.bin/xlint/lint1/msg_332.c index 4a8cedab0408..908936a8ce3d 100644 --- a/tests/usr.bin/xlint/lint1/msg_332.c +++ b/tests/usr.bin/xlint/lint1/msg_332.c @@ -1,11 +1,11 @@ -/* $NetBSD: msg_332.c,v 1.4 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_332.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_332.c" // Test for message: right operand of '%s' must be bool, not '%s' [332] // // See d_c99_bool_strict.c for many more examples. -/* lint1-extra-flags: -T */ +/* lint1-extra-flags: -T -X 351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_334.c b/tests/usr.bin/xlint/lint1/msg_334.c index 837274c2b4a9..d77551b61c33 100644 --- a/tests/usr.bin/xlint/lint1/msg_334.c +++ b/tests/usr.bin/xlint/lint1/msg_334.c @@ -1,11 +1,11 @@ -/* $NetBSD: msg_334.c,v 1.2 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_334.c,v 1.3 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_334.c" // Test for message: argument #%d expects '%s', gets passed '%s' [334] // // See d_c99_bool_strict.c for many more examples. -/* lint1-extra-flags: -T */ +/* lint1-extra-flags: -T -X 351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_336.c b/tests/usr.bin/xlint/lint1/msg_336.c index 031e03bd2c0c..31f2504b5795 100644 --- a/tests/usr.bin/xlint/lint1/msg_336.c +++ b/tests/usr.bin/xlint/lint1/msg_336.c @@ -1,11 +1,11 @@ -/* $NetBSD: msg_336.c,v 1.4 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_336.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_336.c" // Test for message: left operand of '%s' must not be bool [336] // // See d_c99_bool_strict.c for many more examples. -/* lint1-extra-flags: -T */ +/* lint1-extra-flags: -T -X 351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_337.c b/tests/usr.bin/xlint/lint1/msg_337.c index b7361e712404..2e2cb78a53d9 100644 --- a/tests/usr.bin/xlint/lint1/msg_337.c +++ b/tests/usr.bin/xlint/lint1/msg_337.c @@ -1,11 +1,11 @@ -/* $NetBSD: msg_337.c,v 1.4 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_337.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_337.c" // Test for message: right operand of '%s' must not be bool [337] // // See d_c99_bool_strict.c for many more examples. -/* lint1-extra-flags: -T */ +/* lint1-extra-flags: -T -X 351 */ typedef _Bool bool; diff --git a/tests/usr.bin/xlint/lint1/msg_338.c b/tests/usr.bin/xlint/lint1/msg_338.c index 687abc0ebecc..777b2b7928e8 100644 --- a/tests/usr.bin/xlint/lint1/msg_338.c +++ b/tests/usr.bin/xlint/lint1/msg_338.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_338.c,v 1.8 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_338.c,v 1.9 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_338.c" // Test for message: option '%c' should be handled in the switch [338] +/* lint1-extra-flags: -X 351 */ + int getopt(int, char *const *, const char *); extern char *optarg; diff --git a/tests/usr.bin/xlint/lint1/msg_339.c b/tests/usr.bin/xlint/lint1/msg_339.c index baf437028473..69e812125cdf 100644 --- a/tests/usr.bin/xlint/lint1/msg_339.c +++ b/tests/usr.bin/xlint/lint1/msg_339.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_339.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_339.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_339.c" // Test for message: option '%c' should be listed in the options string [339] +/* lint1-extra-flags: -X 351 */ + int getopt(int, char *const *, const char *); extern char *optarg; diff --git a/tests/usr.bin/xlint/lint1/msg_341.c b/tests/usr.bin/xlint/lint1/msg_341.c index 478bee985020..68e28939a97b 100644 --- a/tests/usr.bin/xlint/lint1/msg_341.c +++ b/tests/usr.bin/xlint/lint1/msg_341.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_341.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_341.c,v 1.3 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_341.c" // Test for message: argument to '%s' must be 'unsigned char' or EOF, not '%s' [341] @@ -8,6 +8,8 @@ * argument. */ +/* lint1-extra-flags: -X 351 */ + /* NetBSD 9.99.81, */ extern const unsigned short *_ctype_tab_; extern const short *_tolower_tab_; diff --git a/tests/usr.bin/xlint/lint1/msg_342.c b/tests/usr.bin/xlint/lint1/msg_342.c index 3ba2053e0f78..27ae8c023a4d 100644 --- a/tests/usr.bin/xlint/lint1/msg_342.c +++ b/tests/usr.bin/xlint/lint1/msg_342.c @@ -1,4 +1,4 @@ -/* $NetBSD: msg_342.c,v 1.4 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_342.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_342.c" // Test for message: argument to '%s' must be cast to 'unsigned char', not to '%s' [342] @@ -8,6 +8,8 @@ * argument. */ +/* lint1-extra-flags: -X 351 */ + /* NetBSD 9.99.81, */ extern const unsigned short *_ctype_tab_; extern const short *_tolower_tab_; diff --git a/tests/usr.bin/xlint/lint1/msg_343.c b/tests/usr.bin/xlint/lint1/msg_343.c index 2f59524c77c1..63eaa4ed27bb 100644 --- a/tests/usr.bin/xlint/lint1/msg_343.c +++ b/tests/usr.bin/xlint/lint1/msg_343.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_343.c,v 1.8 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: msg_343.c,v 1.9 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_343.c" /* Test for message: static array size is a C11 extension [343] */ -/* lint1-flags: -Sw */ +/* lint1-flags: -Sw -X 351 */ void takes_int_pointer(int []); void takes_int_pointer_with_ignored_size(int [3]); diff --git a/tests/usr.bin/xlint/lint1/msg_346.c b/tests/usr.bin/xlint/lint1/msg_346.c index 85ac097783d3..f83d3b061301 100644 --- a/tests/usr.bin/xlint/lint1/msg_346.c +++ b/tests/usr.bin/xlint/lint1/msg_346.c @@ -1,8 +1,10 @@ -/* $NetBSD: msg_346.c,v 1.7 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_346.c,v 1.8 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_346.c" // Test for message: call to '%s' effectively discards 'const' from argument [346] +/* lint1-extra-flags: -X 351 */ + typedef unsigned long size_t; void* memchr(const void *, int, size_t); /* C99 7.21.5.1 */ diff --git a/tests/usr.bin/xlint/lint1/msg_347.c b/tests/usr.bin/xlint/lint1/msg_347.c index 0fe31b1e7cdf..e7f8ed735d01 100644 --- a/tests/usr.bin/xlint/lint1/msg_347.c +++ b/tests/usr.bin/xlint/lint1/msg_347.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_347.c,v 1.4 2022/06/11 11:52:13 rillig Exp $ */ +/* $NetBSD: msg_347.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_347.c" // Test for message: redeclaration of '%s' with type '%s', expected '%s' [347] -/* lint1-extra-flags: -r */ +/* lint1-extra-flags: -r -X 351 */ /* * Message 27 already covers redeclarations, but it doesn't include enough diff --git a/tests/usr.bin/xlint/lint1/msg_348.c b/tests/usr.bin/xlint/lint1/msg_348.c index 0ba1c552c526..b0803a705e92 100644 --- a/tests/usr.bin/xlint/lint1/msg_348.c +++ b/tests/usr.bin/xlint/lint1/msg_348.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_348.c,v 1.8 2023/01/14 11:15:07 rillig Exp $ */ +/* $NetBSD: msg_348.c,v 1.9 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_348.c" // Test for message 348: maximum value %d of '%s' does not match maximum array index %d [348] -/* lint1-extra-flags: -r */ +/* lint1-extra-flags: -r -X 351 */ enum color { red, diff --git a/tests/usr.bin/xlint/lint1/msg_349.c b/tests/usr.bin/xlint/lint1/msg_349.c index 9d432afc1068..3724844cb2c8 100644 --- a/tests/usr.bin/xlint/lint1/msg_349.c +++ b/tests/usr.bin/xlint/lint1/msg_349.c @@ -1,9 +1,9 @@ -/* $NetBSD: msg_349.c,v 1.1 2022/05/12 20:49:21 rillig Exp $ */ +/* $NetBSD: msg_349.c,v 1.2 2023/03/28 14:44:35 rillig Exp $ */ # 3 "msg_349.c" // Test for message 349: non type argument to alignof is a GCC extension [348] -/* lint1-flags: -S -w */ +/* lint1-flags: -S -w -X 351 */ unsigned long c11_type = _Alignof(int); diff --git a/tests/usr.bin/xlint/lint1/msg_351.c b/tests/usr.bin/xlint/lint1/msg_351.c new file mode 100644 index 000000000000..b1b7da027bd6 --- /dev/null +++ b/tests/usr.bin/xlint/lint1/msg_351.c @@ -0,0 +1,37 @@ +/* $NetBSD: msg_351.c,v 1.1 2023/03/28 14:44:35 rillig Exp $ */ +# 3 "msg_351.c" + +// Test for message 351: 'extern' declaration of '%s' outside a header [351] + +/* expect+1: warning: 'extern' declaration of 'implicitly_extern_function' outside a header [351] */ +void implicitly_extern_function(void); +/* expect+1: warning: 'extern' declaration of 'explicitly_extern_function' outside a header [351] */ +extern void explicitly_extern_function(void); + +/* expect+1: warning: 'extern' declaration of 'definition' outside a header [351] */ +int definition; +/* expect+1: warning: 'extern' declaration of 'reference' outside a header [351] */ +extern int reference; +/* expect+1: warning: static variable 'file_scoped_definition' unused [226] */ +static int file_scoped_definition; + + +# 18 "header.h" 1 3 4 +static int static_def; +int external_def; +extern int external_ref; + +static int static_func_def(void); +int extern_func_decl(void); +extern int extern_func_decl_verbose(void); + +# 29 "msg_351.c" 2 +/* expect+1: warning: static variable 'static_def' unused [226] */ +static int static_def; +int external_def; +extern int external_ref; + +/* expect+1: warning: static function 'static_func_def' declared but not defined [290] */ +static int static_func_def(void); +int extern_func_decl(void); +extern int extern_func_decl_verbose(void); diff --git a/tests/usr.bin/xlint/lint1/op_colon.c b/tests/usr.bin/xlint/lint1/op_colon.c index 5a42fcecbe71..6970ba3b70d7 100644 --- a/tests/usr.bin/xlint/lint1/op_colon.c +++ b/tests/usr.bin/xlint/lint1/op_colon.c @@ -1,11 +1,11 @@ -/* $NetBSD: op_colon.c,v 1.6 2023/01/04 05:25:08 rillig Exp $ */ +/* $NetBSD: op_colon.c,v 1.7 2023/03/28 14:44:35 rillig Exp $ */ # 3 "op_colon.c" /* * Test handling of the operator ':', as part of the '?:'. */ -/* lint1-extra-flags: -p */ +/* lint1-extra-flags: -p -X 351 */ struct canary { int member; diff --git a/tests/usr.bin/xlint/lint1/op_shl_lp64.c b/tests/usr.bin/xlint/lint1/op_shl_lp64.c index 8fd461ea2769..454f91c3fe7a 100644 --- a/tests/usr.bin/xlint/lint1/op_shl_lp64.c +++ b/tests/usr.bin/xlint/lint1/op_shl_lp64.c @@ -1,4 +1,4 @@ -/* $NetBSD: op_shl_lp64.c,v 1.4 2022/08/19 19:40:39 rillig Exp $ */ +/* $NetBSD: op_shl_lp64.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "op_shl_lp64.c" /* @@ -12,6 +12,7 @@ */ /* lint1-only-if: lp64 */ +/* lint1-extra-flags: -X 351 */ const __uint128_t zero105 = (((__uint128_t)1) << 105) diff --git a/tests/usr.bin/xlint/lint1/parse_init_declarator.c b/tests/usr.bin/xlint/lint1/parse_init_declarator.c index 22300a1cfb58..e04a6d3ac294 100644 --- a/tests/usr.bin/xlint/lint1/parse_init_declarator.c +++ b/tests/usr.bin/xlint/lint1/parse_init_declarator.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse_init_declarator.c,v 1.3 2021/07/25 22:03:42 rillig Exp $ */ +/* $NetBSD: parse_init_declarator.c,v 1.4 2023/03/28 14:44:35 rillig Exp $ */ # 3 "parse_init_declarator.c" /* @@ -8,6 +8,8 @@ * See also: GCC, c-parser.cpp, function c_parser_declaration_or_fndef. */ +/* lint1-extra-flags: -X 351 */ + int global_var; int *init_declarator_without_initializer diff --git a/tests/usr.bin/xlint/lint1/parse_stmt_error.c b/tests/usr.bin/xlint/lint1/parse_stmt_error.c index 43e1f260e8c8..b3812ada4430 100644 --- a/tests/usr.bin/xlint/lint1/parse_stmt_error.c +++ b/tests/usr.bin/xlint/lint1/parse_stmt_error.c @@ -1,10 +1,12 @@ -/* $NetBSD: parse_stmt_error.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: parse_stmt_error.c,v 1.3 2023/03/28 14:44:35 rillig Exp $ */ # 3 "parse_stmt_error.c" /* * Test parsing of errors in selection statements (if, switch). */ +/* lint1-extra-flags: -X 351 */ + void do_nothing(void); void diff --git a/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c b/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c index 33a56f2b0a6f..e708869d268e 100644 --- a/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c +++ b/tests/usr.bin/xlint/lint1/parse_stmt_iter_error.c @@ -1,10 +1,12 @@ -/* $NetBSD: parse_stmt_iter_error.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: parse_stmt_iter_error.c,v 1.3 2023/03/28 14:44:35 rillig Exp $ */ # 3 "parse_stmt_iter_error.c" /* * Test parsing of errors in iteration statements (while, do, for). */ +/* lint1-extra-flags: -X 351 */ + void do_nothing(void); void diff --git a/tests/usr.bin/xlint/lint1/parse_type_name.c b/tests/usr.bin/xlint/lint1/parse_type_name.c index 1290df5289b7..63387a320977 100644 --- a/tests/usr.bin/xlint/lint1/parse_type_name.c +++ b/tests/usr.bin/xlint/lint1/parse_type_name.c @@ -1,4 +1,4 @@ -/* $NetBSD: parse_type_name.c,v 1.9 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: parse_type_name.c,v 1.10 2023/03/28 14:44:35 rillig Exp $ */ # 3 "parse_type_name.c" /* @@ -6,6 +6,8 @@ * in the expression 'sizeof(type_name)'. */ +/* lint1-extra-flags: -X 351 */ + void sink(unsigned long); void diff --git a/tests/usr.bin/xlint/lint1/platform_ilp32_int.c b/tests/usr.bin/xlint/lint1/platform_ilp32_int.c index 9965439bad80..bfd1ccc17e5b 100644 --- a/tests/usr.bin/xlint/lint1/platform_ilp32_int.c +++ b/tests/usr.bin/xlint/lint1/platform_ilp32_int.c @@ -1,4 +1,4 @@ -/* $NetBSD: platform_ilp32_int.c,v 1.1 2023/02/27 23:07:53 rillig Exp $ */ +/* $NetBSD: platform_ilp32_int.c,v 1.2 2023/03/28 14:44:35 rillig Exp $ */ # 3 "platform_ilp32_int.c" /* @@ -6,8 +6,8 @@ * pointer types and where size_t is unsigned int, not unsigned long. */ -/* lint1-extra-flags: -c -h -a -p -b -r -z */ /* lint1-only-if: ilp32 int */ +/* lint1-extra-flags: -c -h -a -p -b -r -z -X 351 */ int s32; unsigned int u32; diff --git a/tests/usr.bin/xlint/lint1/platform_ilp32_long.c b/tests/usr.bin/xlint/lint1/platform_ilp32_long.c index 11eea10b36b4..5bb4efc78fa8 100644 --- a/tests/usr.bin/xlint/lint1/platform_ilp32_long.c +++ b/tests/usr.bin/xlint/lint1/platform_ilp32_long.c @@ -1,4 +1,4 @@ -/* $NetBSD: platform_ilp32_long.c,v 1.1 2023/02/27 23:07:53 rillig Exp $ */ +/* $NetBSD: platform_ilp32_long.c,v 1.2 2023/03/28 14:44:35 rillig Exp $ */ # 3 "platform_ilp32_long.c" /* @@ -10,8 +10,8 @@ * 'long' (or more probably 'size_t') to 'int', which can lose accuracy. */ -/* lint1-extra-flags: -c -h -a -p -b -r -z */ /* lint1-only-if: ilp32 long */ +/* lint1-extra-flags: -c -h -a -p -b -r -z -X 351 */ int s32; unsigned int u32; diff --git a/tests/usr.bin/xlint/lint1/platform_int.c b/tests/usr.bin/xlint/lint1/platform_int.c index fd75c720a0b3..e354442ec582 100644 --- a/tests/usr.bin/xlint/lint1/platform_int.c +++ b/tests/usr.bin/xlint/lint1/platform_int.c @@ -1,4 +1,4 @@ -/* $NetBSD: platform_int.c,v 1.4 2022/04/16 18:41:21 rillig Exp $ */ +/* $NetBSD: platform_int.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "platform_int.c" /* @@ -6,8 +6,8 @@ * int and ptr_diff is signed int. */ -/* lint1-flags: -g -w -c -h -a -p -b -r -z */ /* lint1-only-if: int */ +/* lint1-flags: -g -w -c -h -a -p -b -r -z -X 351 */ void to_size(typeof(sizeof(int))); diff --git a/tests/usr.bin/xlint/lint1/platform_long.c b/tests/usr.bin/xlint/lint1/platform_long.c index 8fcde9eeeaae..9be41273ae51 100644 --- a/tests/usr.bin/xlint/lint1/platform_long.c +++ b/tests/usr.bin/xlint/lint1/platform_long.c @@ -1,4 +1,4 @@ -/* $NetBSD: platform_long.c,v 1.4 2022/06/11 11:52:13 rillig Exp $ */ +/* $NetBSD: platform_long.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "platform_long.c" /* @@ -6,8 +6,8 @@ * long and ptr_diff is signed long. */ -/* lint1-extra-flags: -c -h -a -p -b -r -z */ /* lint1-only-if: long */ +/* lint1-extra-flags: -c -h -a -p -b -r -z -X 351 */ void to_size(typeof(sizeof(int))); diff --git a/tests/usr.bin/xlint/lint1/platform_lp64.c b/tests/usr.bin/xlint/lint1/platform_lp64.c index 3f2425708f12..17639ae46294 100644 --- a/tests/usr.bin/xlint/lint1/platform_lp64.c +++ b/tests/usr.bin/xlint/lint1/platform_lp64.c @@ -1,4 +1,4 @@ -/* $NetBSD: platform_lp64.c,v 1.4 2023/02/22 22:12:35 rillig Exp $ */ +/* $NetBSD: platform_lp64.c,v 1.5 2023/03/28 14:44:35 rillig Exp $ */ # 3 "platform_lp64.c" /* @@ -6,8 +6,8 @@ * long and pointer types. */ -/* lint1-extra-flags: -c -h -a -p -b -r -z */ /* lint1-only-if: lp64 */ +/* lint1-extra-flags: -c -h -a -p -b -r -z -X 351 */ int s32; unsigned int u32; diff --git a/tests/usr.bin/xlint/lint1/queries.c b/tests/usr.bin/xlint/lint1/queries.c index a54bbe322cdb..d7f1f434e1c6 100644 --- a/tests/usr.bin/xlint/lint1/queries.c +++ b/tests/usr.bin/xlint/lint1/queries.c @@ -1,4 +1,4 @@ -/* $NetBSD: queries.c,v 1.9 2023/01/15 14:00:09 rillig Exp $ */ +/* $NetBSD: queries.c,v 1.10 2023/03/28 14:44:35 rillig Exp $ */ # 3 "queries.c" /* @@ -15,7 +15,7 @@ * such as casts between arithmetic types. */ -/* lint1-extra-flags: -q 1,2,3,4,5,6,7 */ +/* lint1-extra-flags: -q 1,2,3,4,5,6,7 -X 351 */ typedef unsigned char u8_t; typedef unsigned short u16_t; diff --git a/tests/usr.bin/xlint/lint1/stmt_if.c b/tests/usr.bin/xlint/lint1/stmt_if.c index 643ba7ab91ec..56995ca503c6 100644 --- a/tests/usr.bin/xlint/lint1/stmt_if.c +++ b/tests/usr.bin/xlint/lint1/stmt_if.c @@ -1,10 +1,12 @@ -/* $NetBSD: stmt_if.c,v 1.2 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: stmt_if.c,v 1.3 2023/03/28 14:44:35 rillig Exp $ */ # 3 "stmt_if.c" /* * Test parsing of 'if' statements. */ +/* lint1-extra-flags: -X 351 */ + void println(const char *); void diff --git a/usr.bin/xlint/lint1/Makefile b/usr.bin/xlint/lint1/Makefile index 8e6ef41e12e1..7218e65a952c 100644 --- a/usr.bin/xlint/lint1/Makefile +++ b/usr.bin/xlint/lint1/Makefile @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.94 2023/02/27 23:07:53 rillig Exp $ +# $NetBSD: Makefile,v 1.95 2023/03/28 14:44:35 rillig Exp $ .include @@ -19,9 +19,11 @@ CWARNFLAGS.clang+= -Wno-error=implicit-int-float-conversion LINTFLAGS+= -T LOBJS.${PROG}+= ${SRCS:M*.y:.y=.ln} LOBJS.${PROG}+= ${SRCS:M*.l:.l=.ln} +LINTFLAGS.cgram.c+= -X 351 # 'extern' declaration in .c file LINTFLAGS.scan.c+= -X 107,126,330,331,332,333 # strict bool mode LINTFLAGS.scan.c+= -X 192,214 # due to suppressed bool errors LINTFLAGS.scan.c+= -X 307 # static variable unused +LINTFLAGS.scan.c+= -X 351 # 'extern' declaration in .c file CPPFLAGS+= -DIS_LINT1 CPPFLAGS+= -I${.CURDIR} -I${.OBJDIR} @@ -56,9 +58,10 @@ ${MAN}.date: err.c -e 1q \ ${.ALLSRC} > ${.TARGET} -# Extra -UYYDEBUG since cgram.c contains 'int yydebug; if (yydebug)'. +# Extra -UYYDEBUG for lint's strict bool mode, since cgram.c contains 'int +# yydebug; if (yydebug)'. cgram.ln: cgram.c - ${LINT} ${LINTFLAGS} \ + ${LINT} ${LINTFLAGS} ${LINTFLAGS.${.IMPSRC}} \ ${CPPFLAGS:C/-([IDUW]) */-\1/Wg:M-[IDUW]*} \ -i -UYYDEBUG ${.IMPSRC} diff --git a/usr.bin/xlint/lint1/decl.c b/usr.bin/xlint/lint1/decl.c index 2f365ad46285..2a265a563a55 100644 --- a/usr.bin/xlint/lint1/decl.c +++ b/usr.bin/xlint/lint1/decl.c @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.305 2023/01/29 18:13:56 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.306 2023/03/28 14:44:35 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: decl.c,v 1.305 2023/01/29 18:13:56 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.306 2023/03/28 14:44:35 rillig Exp $"); #endif #include @@ -1515,9 +1515,8 @@ old_style_function(sym_t *decl, sym_t *args) } /* - * Lists of identifiers in functions declarations are allowed only if - * it's also a function definition. If this is not the case, print an - * error message. + * In a function declaration, a list of identifiers (as opposed to a list of + * types) is allowed only if it's also a function definition. */ void check_function_definition(sym_t *sym, bool msg) @@ -1570,7 +1569,7 @@ declarator_name(sym_t *sym) * static and external symbols without "extern" are * considered to be tentatively defined, external * symbols with "extern" are declared, and typedef names - * are defined. Tentative defined and declared symbols + * are defined. Tentatively defined and declared symbols * may become defined if an initializer is present or * this is a function definition. */ @@ -1922,9 +1921,28 @@ enumeration_constant(sym_t *sym, int val, bool impl) return sym; } -/* - * Process a single external declarator. - */ +static bool +ends_with(const char *s, const char *suffix) +{ + size_t s_len = strlen(s); + size_t suffix_len = strlen(suffix); + return s_len >= suffix_len && + memcmp(s + s_len - suffix_len, suffix, suffix_len) == 0; +} + +static void +check_extern_declaration(const sym_t *sym) +{ + + if (sym->s_scl == EXTERN && + dcs->d_redeclared_symbol == NULL && + ends_with(curr_pos.p_file, ".c")) { + /* 'extern' declaration of '%s' outside a header */ + warning(351, sym->s_name); + } +} + +/* Process a single external or 'static' declarator. */ static void declare_extern(sym_t *dsym, bool initflg, sbuf_t *renaming) { @@ -1937,6 +1955,8 @@ declare_extern(sym_t *dsym, bool initflg, sbuf_t *renaming) dsym->s_rename = s; } + check_extern_declaration(dsym); + check_function_definition(dsym, true); check_type(dsym); diff --git a/usr.bin/xlint/lint1/err.c b/usr.bin/xlint/lint1/err.c index fc851c821792..8d60bd29ca9a 100644 --- a/usr.bin/xlint/lint1/err.c +++ b/usr.bin/xlint/lint1/err.c @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.189 2023/02/22 22:30:40 rillig Exp $ */ +/* $NetBSD: err.c,v 1.190 2023/03/28 14:44:35 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: err.c,v 1.189 2023/02/22 22:30:40 rillig Exp $"); +__RCSID("$NetBSD: err.c,v 1.190 2023/03/28 14:44:35 rillig Exp $"); #endif #include @@ -406,6 +406,7 @@ static const char *const msgs[] = { "maximum value %d of '%s' does not match maximum array index %d", /* 348 */ "non type argument to alignof is a GCC extension", /* 349 */ "'_Atomic' requires C11 or later", /* 350 */ + "'extern' declaration of '%s' outside a header", /* 351 */ }; static bool is_suppressed[sizeof(msgs) / sizeof(msgs[0])]; diff --git a/usr.bin/xlint/lint1/externs1.h b/usr.bin/xlint/lint1/externs1.h index 818489ea0e31..c02b8f9114a4 100644 --- a/usr.bin/xlint/lint1/externs1.h +++ b/usr.bin/xlint/lint1/externs1.h @@ -1,4 +1,4 @@ -/* $NetBSD: externs1.h,v 1.174 2023/02/18 15:21:34 rillig Exp $ */ +/* $NetBSD: externs1.h,v 1.175 2023/03/28 14:44:35 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -31,8 +31,10 @@ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include + /* - * main.c + * main1.c */ extern int aflag; extern bool bflag; @@ -56,6 +58,8 @@ extern bool allow_c99; extern bool allow_c11; extern bool allow_gcc; +extern sig_atomic_t fpe; + extern void norecover(void); /* diff --git a/usr.bin/xlint/lint1/func.c b/usr.bin/xlint/lint1/func.c index dfb5e3840bec..1d3a5d25ae72 100644 --- a/usr.bin/xlint/lint1/func.c +++ b/usr.bin/xlint/lint1/func.c @@ -1,4 +1,4 @@ -/* $NetBSD: func.c,v 1.149 2023/02/21 19:47:21 rillig Exp $ */ +/* $NetBSD: func.c,v 1.150 2023/03/28 14:44:35 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: func.c,v 1.149 2023/02/21 19:47:21 rillig Exp $"); +__RCSID("$NetBSD: func.c,v 1.150 2023/03/28 14:44:35 rillig Exp $"); #endif #include @@ -76,7 +76,7 @@ bool warn_about_unreachable; bool seen_fallthrough; /* The innermost control statement */ -control_statement *cstmt; +static control_statement *cstmt; /* * Number of arguments which will be checked for usage in following diff --git a/usr.bin/xlint/lint1/tree.c b/usr.bin/xlint/lint1/tree.c index 5db5eec50a0e..3a7d116e9b22 100644 --- a/usr.bin/xlint/lint1/tree.c +++ b/usr.bin/xlint/lint1/tree.c @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.506 2023/02/24 19:18:50 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.507 2023/03/28 14:44:35 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.506 2023/02/24 19:18:50 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.507 2023/03/28 14:44:35 rillig Exp $"); #endif #include @@ -60,9 +60,6 @@ typedef struct integer_constraints { } integer_constraints; -extern sig_atomic_t fpe; - - static uint64_t u64_fill_right(uint64_t x) { diff --git a/usr.bin/xlint/lint2/main2.c b/usr.bin/xlint/lint2/main2.c index 0642f0ba9658..6eff53a01f72 100644 --- a/usr.bin/xlint/lint2/main2.c +++ b/usr.bin/xlint/lint2/main2.c @@ -1,4 +1,4 @@ -/* $NetBSD: main2.c,v 1.27 2023/02/21 19:32:55 rillig Exp $ */ +/* $NetBSD: main2.c,v 1.28 2023/03/28 14:44:35 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: main2.c,v 1.27 2023/02/21 19:32:55 rillig Exp $"); +__RCSID("$NetBSD: main2.c,v 1.28 2023/03/28 14:44:35 rillig Exp $"); #endif #include @@ -84,7 +84,7 @@ bool Fflag; * other input files has been read and, for Cflag, after the new lint library * has been written. */ -const char **libs; +static const char **libs; static void usage(void) __attribute__((noreturn));