Module Name: src Committed By: rillig Date: Sat Oct 1 09:42:40 UTC 2022
Modified Files: src/tests/usr.bin/xlint/lint1: d_decl_old_style_arguments.c d_lint_assert.c decl.c emit.c msg_001.c msg_001_c90.c msg_007.c msg_022.c msg_030.c msg_032.c msg_053.c msg_062.c msg_072.c msg_216.c msg_250.c msg_299.c msg_300.c src/usr.bin/xlint/lint1: cgram.y decl.c emit1.c err.c func.c lint1.h tree.c src/usr.bin/xlint/lint2: chk.c src/usr.bin/xlint/xlint: lint.1 Log Message: lint: add hyphen to adjective 'old-style' To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 \ src/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c \ src/tests/usr.bin/xlint/lint1/d_lint_assert.c \ src/tests/usr.bin/xlint/lint1/msg_030.c \ src/tests/usr.bin/xlint/lint1/msg_032.c \ src/tests/usr.bin/xlint/lint1/msg_053.c \ src/tests/usr.bin/xlint/lint1/msg_062.c \ src/tests/usr.bin/xlint/lint1/msg_216.c \ src/tests/usr.bin/xlint/lint1/msg_250.c cvs rdiff -u -r1.19 -r1.20 src/tests/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.13 -r1.14 src/tests/usr.bin/xlint/lint1/emit.c cvs rdiff -u -r1.7 -r1.8 src/tests/usr.bin/xlint/lint1/msg_001.c cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_001_c90.c cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_007.c \ src/tests/usr.bin/xlint/lint1/msg_022.c cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/xlint/lint1/msg_072.c cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_299.c \ src/tests/usr.bin/xlint/lint1/msg_300.c cvs rdiff -u -r1.423 -r1.424 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.299 -r1.300 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.63 -r1.64 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.183 -r1.184 src/usr.bin/xlint/lint1/err.c cvs rdiff -u -r1.144 -r1.145 src/usr.bin/xlint/lint1/func.c cvs rdiff -u -r1.157 -r1.158 src/usr.bin/xlint/lint1/lint1.h cvs rdiff -u -r1.480 -r1.481 src/usr.bin/xlint/lint1/tree.c cvs rdiff -u -r1.51 -r1.52 src/usr.bin/xlint/lint2/chk.c cvs rdiff -u -r1.54 -r1.55 src/usr.bin/xlint/xlint/lint.1 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c diff -u src/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c:1.5 src/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c:1.6 --- src/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c:1.5 Mon Jun 20 21:13:36 2022 +++ src/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c Sat Oct 1 09:42:40 2022 @@ -1,7 +1,7 @@ # 2 "d_decl_old_style_arguments.c" /* - * A function is declared with a prototype, followed by an old style definition + * A function is declared with a prototype, followed by an old-style definition * that is completely different. */ Index: src/tests/usr.bin/xlint/lint1/d_lint_assert.c diff -u src/tests/usr.bin/xlint/lint1/d_lint_assert.c:1.5 src/tests/usr.bin/xlint/lint1/d_lint_assert.c:1.6 --- src/tests/usr.bin/xlint/lint1/d_lint_assert.c:1.5 Sat Jan 15 14:22:03 2022 +++ src/tests/usr.bin/xlint/lint1/d_lint_assert.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: d_lint_assert.c,v 1.5 2022/01/15 14:22:03 rillig Exp $ */ +/* $NetBSD: d_lint_assert.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ # 3 "d_lint_assert.c" /* @@ -19,5 +19,5 @@ enum { * Before decl.c 1.196 from 2021-07-10, lint ran into an assertion failure * for 'sym->s_type != NULL' in declare_argument. */ -/* expect+1: warning: old style declaration; add 'int' [1] */ +/* expect+1: warning: old-style declaration; add 'int' [1] */ c(void()); Index: src/tests/usr.bin/xlint/lint1/msg_030.c diff -u src/tests/usr.bin/xlint/lint1/msg_030.c:1.5 src/tests/usr.bin/xlint/lint1/msg_030.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_030.c:1.5 Sat Jun 11 12:24:00 2022 +++ src/tests/usr.bin/xlint/lint1/msg_030.c Sat Oct 1 09:42:40 2022 @@ -1,21 +1,21 @@ -/* $NetBSD: msg_030.c,v 1.5 2022/06/11 12:24:00 rillig Exp $ */ +/* $NetBSD: msg_030.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_030.c" /* Test for message: redeclaration of '%s'; ANSI C requires static [30] */ /* lint1-flags: -sw */ -/* expect+1: error: old style declaration; add 'int' [1] */ +/* expect+1: error: old-style declaration; add 'int' [1] */ static a; /* expect+1: warning: redeclaration of 'a'; ANSI C requires static [30] */ int a; -/* expect+1: error: old style declaration; add 'int' [1] */ +/* expect+1: error: old-style declaration; add 'int' [1] */ static b; /* expect+1: warning: redeclaration of 'b'; ANSI C requires static [30] */ int b = 1; -/* expect+1: error: old style declaration; add 'int' [1] */ +/* expect+1: error: old-style declaration; add 'int' [1] */ static c = 1; /* expect+1: warning: redeclaration of 'c'; ANSI C requires static [30] */ int c; Index: src/tests/usr.bin/xlint/lint1/msg_032.c diff -u src/tests/usr.bin/xlint/lint1/msg_032.c:1.5 src/tests/usr.bin/xlint/lint1/msg_032.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_032.c:1.5 Mon Jun 20 21:13:36 2022 +++ src/tests/usr.bin/xlint/lint1/msg_032.c Sat Oct 1 09:42:40 2022 @@ -1,9 +1,9 @@ -/* $NetBSD: msg_032.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_032.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_032.c" // Test for message: type of argument '%s' defaults to 'int' [32] -/* expect+5: error: old style declaration; add 'int' [1] */ +/* expect+5: error: old-style declaration; add 'int' [1] */ add(a, b, c) /* expect+3: warning: type of argument 'a' defaults to 'int' [32] */ /* expect+2: warning: type of argument 'b' defaults to 'int' [32] */ Index: src/tests/usr.bin/xlint/lint1/msg_053.c diff -u src/tests/usr.bin/xlint/lint1/msg_053.c:1.5 src/tests/usr.bin/xlint/lint1/msg_053.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_053.c:1.5 Mon Jun 20 21:13:36 2022 +++ src/tests/usr.bin/xlint/lint1/msg_053.c Sat Oct 1 09:42:40 2022 @@ -1,9 +1,9 @@ -/* $NetBSD: msg_053.c,v 1.5 2022/06/20 21:13:36 rillig Exp $ */ +/* $NetBSD: msg_053.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_053.c" // Test for message: declared argument '%s' is missing [53] -/* expect+2: error: old style declaration; add 'int' [1] */ +/* expect+2: error: old-style declaration; add 'int' [1] */ oldstyle(argument) int argument; /* expect+1: error: declared argument 'extra_argument' is missing [53] */ Index: src/tests/usr.bin/xlint/lint1/msg_062.c diff -u src/tests/usr.bin/xlint/lint1/msg_062.c:1.5 src/tests/usr.bin/xlint/lint1/msg_062.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_062.c:1.5 Tue Jun 21 21:18:30 2022 +++ src/tests/usr.bin/xlint/lint1/msg_062.c Sat Oct 1 09:42:40 2022 @@ -1,9 +1,9 @@ -/* $NetBSD: msg_062.c,v 1.5 2022/06/21 21:18:30 rillig Exp $ */ +/* $NetBSD: msg_062.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_062.c" // Test for message: function prototype parameters must have types [62] -/* expect+1: error: old style declaration; add 'int' [1] */ +/* expect+1: error: old-style declaration; add 'int' [1] */ outer() { /* expect+2: warning: function prototype parameters must have types [62] */ /* expect+1: warning: dubious static function 'inner' at block level [93] */ Index: src/tests/usr.bin/xlint/lint1/msg_216.c diff -u src/tests/usr.bin/xlint/lint1/msg_216.c:1.5 src/tests/usr.bin/xlint/lint1/msg_216.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_216.c:1.5 Wed Jun 22 19:23:18 2022 +++ src/tests/usr.bin/xlint/lint1/msg_216.c Sat Oct 1 09:42:40 2022 @@ -1,9 +1,9 @@ -/* $NetBSD: msg_216.c,v 1.5 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: msg_216.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_216.c" // Test for message: function '%s' has 'return expr' and 'return' [216] -/* expect+2: error: old style declaration; add 'int' [1] */ +/* expect+2: error: old-style declaration; add 'int' [1] */ random(int n) { if (n < 0) Index: src/tests/usr.bin/xlint/lint1/msg_250.c diff -u src/tests/usr.bin/xlint/lint1/msg_250.c:1.5 src/tests/usr.bin/xlint/lint1/msg_250.c:1.6 --- src/tests/usr.bin/xlint/lint1/msg_250.c:1.5 Fri Jun 17 18:54:53 2022 +++ src/tests/usr.bin/xlint/lint1/msg_250.c Sat Oct 1 09:42:40 2022 @@ -1,10 +1,10 @@ -/* $NetBSD: msg_250.c,v 1.5 2022/06/17 18:54:53 rillig Exp $ */ +/* $NetBSD: msg_250.c,v 1.6 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_250.c" // Test for message: unknown character \%o [250] /* expect+1: error: unknown character \100 [250] */ @deprecated -/* expect+2: error: old style declaration; add 'int' [1] */ +/* expect+2: error: old-style declaration; add 'int' [1] */ /* expect+1: error: syntax error 'char' [249] */ char *gets(void); Index: src/tests/usr.bin/xlint/lint1/decl.c diff -u src/tests/usr.bin/xlint/lint1/decl.c:1.19 src/tests/usr.bin/xlint/lint1/decl.c:1.20 --- src/tests/usr.bin/xlint/lint1/decl.c:1.19 Sun Aug 28 08:41:06 2022 +++ src/tests/usr.bin/xlint/lint1/decl.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.19 2022/08/28 08:41:06 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.20 2022/10/01 09:42:40 rillig Exp $ */ # 3 "decl.c" /* @@ -104,7 +104,7 @@ int declaration_without_type_specifier(void) { const i = 3; - /* expect-1: error: old style declaration; add 'int' [1] */ + /* expect-1: error: old-style declaration; add 'int' [1] */ return i; } @@ -159,15 +159,15 @@ unsigned long sizes = sizeof(const typeof(unsigned_long)) + sizeof(const typeof(unnamed_struct)); -/* expect+2: error: old style declaration; add 'int' [1] */ +/* expect+2: error: old-style declaration; add 'int' [1] */ /* expect+1: error: syntax error 'int' [249] */ thread int thread_int; __thread int thread_int; -/* expect+2: error: old style declaration; add 'int' [1] */ +/* expect+2: error: old-style declaration; add 'int' [1] */ /* expect+1: error: syntax error 'int' [249] */ __thread__ int thread_int; -/* expect+4: error: old style declaration; add 'int' [1] */ +/* expect+4: error: old-style declaration; add 'int' [1] */ /* expect+2: warning: static function 'cover_func_declarator' unused [236] */ static cover_func_declarator(void) Index: src/tests/usr.bin/xlint/lint1/emit.c diff -u src/tests/usr.bin/xlint/lint1/emit.c:1.13 src/tests/usr.bin/xlint/lint1/emit.c:1.14 --- src/tests/usr.bin/xlint/lint1/emit.c:1.13 Wed Jun 22 19:23:18 2022 +++ src/tests/usr.bin/xlint/lint1/emit.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: emit.c,v 1.13 2022/06/22 19:23:18 rillig Exp $ */ +/* $NetBSD: emit.c,v 1.14 2022/10/01 09:42:40 rillig Exp $ */ # 3 "emit.c" /* @@ -121,7 +121,7 @@ extern const volatile int extern_const_v extern void return_void_unknown_parameters(); extern /* implicit int */ return_implicit_int_unknown_parameters(); -/* expect-1: error: old style declaration; add 'int' [1] */ +/* expect-1: error: old-style declaration; add 'int' [1] */ /* For function declarations, the keyword 'extern' is optional. */ extern void extern_return_void_no_parameters(void); /* implicit extern */ void return_void_no_parameters(void); Index: src/tests/usr.bin/xlint/lint1/msg_001.c diff -u src/tests/usr.bin/xlint/lint1/msg_001.c:1.7 src/tests/usr.bin/xlint/lint1/msg_001.c:1.8 --- src/tests/usr.bin/xlint/lint1/msg_001.c:1.7 Sat Jun 11 11:52:13 2022 +++ src/tests/usr.bin/xlint/lint1/msg_001.c Sat Oct 1 09:42:40 2022 @@ -1,26 +1,26 @@ -/* $NetBSD: msg_001.c,v 1.7 2022/06/11 11:52:13 rillig Exp $ */ +/* $NetBSD: msg_001.c,v 1.8 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_001.c" -// Test for message: old style declaration; add 'int' [1] +// Test for message: old-style declaration; add 'int' [1] -/* expect+1: warning: old style declaration; add 'int' [1] */ +/* expect+1: warning: old-style declaration; add 'int' [1] */ old_style = 1; int new_style = 1; -/* expect+2: error: old style declaration; add 'int' [1] */ +/* expect+2: error: old-style declaration; add 'int' [1] */ /* expect+1: warning: static variable 'static_old_style' unused [226] */ static static_old_style = 1; /* expect+1: warning: static variable 'static_new_style' unused [226] */ static int static_new_style = 1; -/* expect+2: error: old style declaration; add 'int' [1] */ +/* expect+2: error: old-style declaration; add 'int' [1] */ extern_implicit_int(void) { } -/* expect+4: error: old style declaration; add 'int' [1] */ +/* expect+4: error: old-style declaration; add 'int' [1] */ /* expect+2: warning: static function 'static_implicit_int' unused [236] */ static static_implicit_int(void) Index: src/tests/usr.bin/xlint/lint1/msg_001_c90.c diff -u src/tests/usr.bin/xlint/lint1/msg_001_c90.c:1.1 src/tests/usr.bin/xlint/lint1/msg_001_c90.c:1.2 --- src/tests/usr.bin/xlint/lint1/msg_001_c90.c:1.1 Thu Jul 8 05:18:49 2021 +++ src/tests/usr.bin/xlint/lint1/msg_001_c90.c Sat Oct 1 09:42:40 2022 @@ -1,8 +1,8 @@ -/* $NetBSD: msg_001_c90.c,v 1.1 2021/07/08 05:18:49 rillig Exp $ */ +/* $NetBSD: msg_001_c90.c,v 1.2 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_001_c90.c" /* - * Test for message: old style declaration; add 'int' [1] + * Test for message: old-style declaration; add 'int' [1] * * In strict C90 mode, an old-style declaration is an error, not merely a * warning. @@ -10,5 +10,5 @@ /* lint1-flags: -s */ -/* expect+1: error: old style declaration; add 'int' [1] */ +/* expect+1: error: old-style declaration; add 'int' [1] */ implicit_global_variable; Index: src/tests/usr.bin/xlint/lint1/msg_007.c diff -u src/tests/usr.bin/xlint/lint1/msg_007.c:1.4 src/tests/usr.bin/xlint/lint1/msg_007.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_007.c:1.4 Sun Apr 24 19:21:01 2022 +++ src/tests/usr.bin/xlint/lint1/msg_007.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_007.c,v 1.4 2022/04/24 19:21:01 rillig Exp $ */ +/* $NetBSD: msg_007.c,v 1.5 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_007.c" // Test for message: only one storage class allowed [7] @@ -6,5 +6,5 @@ /* expect+1: error: only one storage class allowed [7] */ extern static void example(void); -/* expect+1: error: old style declaration; add 'int' [1] */ +/* expect+1: error: old-style declaration; add 'int' [1] */ extern extern_function(void); Index: src/tests/usr.bin/xlint/lint1/msg_022.c diff -u src/tests/usr.bin/xlint/lint1/msg_022.c:1.4 src/tests/usr.bin/xlint/lint1/msg_022.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_022.c:1.4 Tue Apr 5 23:09:19 2022 +++ src/tests/usr.bin/xlint/lint1/msg_022.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_022.c,v 1.4 2022/04/05 23:09:19 rillig Exp $ */ +/* $NetBSD: msg_022.c,v 1.5 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_022.c" // Test for message: incomplete or misplaced function definition [22] @@ -26,5 +26,5 @@ unsigned long sz = sizeof(int(param1, pa ; /* expect+2: error: incomplete or misplaced function definition [22] */ -/* expect+1: warning: old style declaration; add 'int' [1] */ +/* expect+1: warning: old-style declaration; add 'int' [1] */ old_style(arg); Index: src/tests/usr.bin/xlint/lint1/msg_072.c diff -u src/tests/usr.bin/xlint/lint1/msg_072.c:1.6 src/tests/usr.bin/xlint/lint1/msg_072.c:1.7 --- src/tests/usr.bin/xlint/lint1/msg_072.c:1.6 Sun Apr 24 19:21:01 2022 +++ src/tests/usr.bin/xlint/lint1/msg_072.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_072.c,v 1.6 2022/04/24 19:21:01 rillig Exp $ */ +/* $NetBSD: msg_072.c,v 1.7 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_072.c" // Test for message: typedef declares no type name [72] @@ -30,6 +30,6 @@ cover_cgram_declaration(void) /* expect+1: error: syntax error 'missing base type for typedef' [249] */ typedef not_a_type; - /* expect+1: error: old style declaration; add 'int' [1] */ + /* expect+1: error: old-style declaration; add 'int' [1] */ static missing_type; } Index: src/tests/usr.bin/xlint/lint1/msg_299.c diff -u src/tests/usr.bin/xlint/lint1/msg_299.c:1.3 src/tests/usr.bin/xlint/lint1/msg_299.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_299.c:1.3 Thu Jun 16 21:24:41 2022 +++ src/tests/usr.bin/xlint/lint1/msg_299.c Sat Oct 1 09:42:40 2022 @@ -1,7 +1,7 @@ -/* $NetBSD: msg_299.c,v 1.3 2022/06/16 21:24:41 rillig Exp $ */ +/* $NetBSD: msg_299.c,v 1.4 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_299.c" -/* Test for message: prototype does not match old style definition, arg #%d [299] */ +/* Test for message: prototype does not match old-style definition, arg #%d [299] */ /* lint1-flags: -w */ @@ -11,5 +11,5 @@ old_style(x) return x > 0.0; } -/* expect+1: error: prototype does not match old style definition, arg #1 [299] */ +/* expect+1: error: prototype does not match old-style definition, arg #1 [299] */ void old_style(char ch); Index: src/tests/usr.bin/xlint/lint1/msg_300.c diff -u src/tests/usr.bin/xlint/lint1/msg_300.c:1.3 src/tests/usr.bin/xlint/lint1/msg_300.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_300.c:1.3 Fri Jun 17 06:59:16 2022 +++ src/tests/usr.bin/xlint/lint1/msg_300.c Sat Oct 1 09:42:40 2022 @@ -1,16 +1,16 @@ -/* $NetBSD: msg_300.c,v 1.3 2022/06/17 06:59:16 rillig Exp $ */ +/* $NetBSD: msg_300.c,v 1.4 2022/10/01 09:42:40 rillig Exp $ */ # 3 "msg_300.c" -/* Test for message: old style definition [300] */ +/* Test for message: old-style definition [300] */ /* lint1-flags: -wr */ -/* expect+1: old style definition [300] */ +/* expect+1: old-style definition [300] */ old_style(x) double x; { return x > 0.0; } -/* expect+1: error: prototype does not match old style definition, arg #1 [299] */ +/* expect+1: error: prototype does not match old-style definition, arg #1 [299] */ void old_style(char ch); Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.423 src/usr.bin/xlint/lint1/cgram.y:1.424 --- src/usr.bin/xlint/lint1/cgram.y:1.423 Sun Aug 28 10:43:18 2022 +++ src/usr.bin/xlint/lint1/cgram.y Sat Oct 1 09:42:40 2022 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.423 2022/08/28 10:43:18 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.424 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: cgram.y,v 1.423 2022/08/28 10:43:18 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.424 2022/10/01 09:42:40 rillig Exp $"); #endif #include <limits.h> @@ -710,7 +710,7 @@ declaration: /* C99 6.7 */ /* syntax error '%s' */ error(249, "missing base type for typedef"); } else { - /* old style declaration; add 'int' */ + /* old-style declaration; add 'int' */ error(1); } } @@ -1909,10 +1909,10 @@ top_level_declaration: /* C99 6.9 calls begin_type end_type notype_init_declarators T_SEMI { /* TODO: Make this an error in C99 mode as well. */ if (!allow_trad && !allow_c99) { - /* old style declaration; add 'int' */ + /* old-style declaration; add 'int' */ error(1); } else if (allow_c90) { - /* old style declaration; add 'int' */ + /* old-style declaration; add 'int' */ warning(1); } } @@ -1957,14 +1957,14 @@ function_definition: /* C99 6.9.1 */ func_declarator: begin_type end_type notype_declarator { if (!allow_trad) { - /* old style declaration; add 'int' */ + /* old-style declaration; add 'int' */ error(1); } $$ = $3; } | begin_type_declmods end_type notype_declarator { if (!allow_trad) { - /* old style declaration; add 'int' */ + /* old-style declaration; add 'int' */ error(1); } $$ = $3; Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.299 src/usr.bin/xlint/lint1/decl.c:1.300 --- src/usr.bin/xlint/lint1/decl.c:1.299 Sun Aug 28 19:09:12 2022 +++ src/usr.bin/xlint/lint1/decl.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.299 2022/08/28 19:09:12 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.300 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: decl.c,v 1.299 2022/08/28 19:09:12 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.300 2022/10/01 09:42:40 rillig Exp $"); #endif #include <sys/param.h> @@ -611,10 +611,10 @@ end_declaration_level(void) break; case DK_OLD_STYLE_ARG: /* - * All symbols in dcs->d_dlsyms are introduced in old style + * All symbols in dcs->d_dlsyms are introduced in old-style * argument declarations (it's not clean, but possible). * They are appended to the list of symbols declared in - * an old style argument identifier list or a new style + * an old-style argument identifier list or a new style * parameter type list. */ if (di->d_dlsyms != NULL) { @@ -946,7 +946,7 @@ check_type(sym_t *sym) while ((tp = *tpp) != NULL) { t = tp->t_tspec; /* - * If this is the type of an old style function definition, + * If this is the type of an old-style function definition, * a better warning is printed in funcdef(). */ if (t == FUNC && !tp->t_proto && @@ -1486,7 +1486,7 @@ new_style_function(sym_t *args) } /* - * Called for old style function declarations. + * Called for old-style function declarations. */ static void old_style_function(sym_t *decl, sym_t *args) @@ -1633,7 +1633,7 @@ declarator_name(sym_t *sym) } /* - * Process a name in the list of formal parameters in an old style function + * Process a name in the list of formal parameters in an old-style function * definition. */ sym_t * @@ -1975,7 +1975,7 @@ declare_extern(sym_t *dsym, bool initflg if ((rdsym = dcs->d_redeclared_symbol) != NULL) { /* - * If the old symbol stems from an old style function + * If the old symbol stems from an old-style function * definition, we have remembered the params in * rdsym->s_old_style_args and compare them with the params * of the prototype. @@ -2287,7 +2287,7 @@ matches_no_arg_function(const type_t *tp /* * Compares a prototype declaration with the remembered arguments of - * a previous old style function definition. + * a previous old-style function definition. */ static bool check_old_style_definition(sym_t *rdsym, sym_t *dsym) @@ -2327,7 +2327,7 @@ check_old_style_definition(sym_t *rdsym, if (!types_compatible(arg->s_type, parg->s_type, true, true, &dowarn) || dowarn) { - /* prototype does not match old style ... */ + /* prototype does not match old-style ... */ error(299, n); msg = true; } @@ -2338,7 +2338,7 @@ check_old_style_definition(sym_t *rdsym, end: if (msg && rflag) { - /* old style definition */ + /* old-style definition */ message_at(300, &rdsym->s_def_pos); } @@ -2523,8 +2523,8 @@ check_func_lint_directives(void) } /* - * Warn about arguments in old style function definitions that default to int. - * Check that an old style function definition is compatible to a previous + * Warn about arguments in old-style function definitions that default to int. + * Check that an old-style function definition is compatible to a previous * prototype. */ void @@ -2538,7 +2538,7 @@ check_func_old_style_arguments(void) pargs = funcsym->s_type->t_args; /* - * print a warning for each argument of an old style function + * print a warning for each argument of an old-style function * definition which defaults to int */ for (arg = args; arg != NULL; arg = arg->s_next) { @@ -2551,7 +2551,7 @@ check_func_old_style_arguments(void) } /* - * If this is an old style function definition and a prototype + * If this is an old-style function definition and a prototype * exists, compare the types of arguments. */ if (funcsym->s_osdef && funcsym->s_type->t_proto) { @@ -2590,7 +2590,7 @@ check_func_old_style_arguments(void) } /* - * Checks compatibility of an old style function definition with a previous + * Checks compatibility of an old-style function definition with a previous * prototype declaration. * Returns true if the position of the previous declaration should be reported. */ Index: src/usr.bin/xlint/lint1/emit1.c diff -u src/usr.bin/xlint/lint1/emit1.c:1.63 src/usr.bin/xlint/lint1/emit1.c:1.64 --- src/usr.bin/xlint/lint1/emit1.c:1.63 Tue Jun 21 22:10:30 2022 +++ src/usr.bin/xlint/lint1/emit1.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: emit1.c,v 1.63 2022/06/21 22:10:30 rillig Exp $ */ +/* $NetBSD: emit1.c,v 1.64 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: emit1.c,v 1.63 2022/06/21 22:10:30 rillig Exp $"); +__RCSID("$NetBSD: emit1.c,v 1.64 2022/10/01 09:42:40 rillig Exp $"); #endif #include "lint1.h" @@ -308,7 +308,7 @@ outfdef(const sym_t *fsym, const pos_t * outchar('u'); if (osdef) - outchar('o'); /* old style function definition */ + outchar('o'); /* old-style function definition */ if (fsym->s_inline) outchar('i'); Index: src/usr.bin/xlint/lint1/err.c diff -u src/usr.bin/xlint/lint1/err.c:1.183 src/usr.bin/xlint/lint1/err.c:1.184 --- src/usr.bin/xlint/lint1/err.c:1.183 Fri Aug 19 19:40:39 2022 +++ src/usr.bin/xlint/lint1/err.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.183 2022/08/19 19:40:39 rillig Exp $ */ +/* $NetBSD: err.c,v 1.184 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: err.c,v 1.183 2022/08/19 19:40:39 rillig Exp $"); +__RCSID("$NetBSD: err.c,v 1.184 2022/10/01 09:42:40 rillig Exp $"); #endif #include <limits.h> @@ -56,7 +56,7 @@ int sytxerr; static const char *const msgs[] = { "empty declaration", /* 0 */ - "old style declaration; add 'int'", /* 1 */ + "old-style declaration; add 'int'", /* 1 */ "empty declaration", /* 2 */ "'%s' declared in argument declaration list", /* 3 */ "illegal type combination", /* 4 */ @@ -354,8 +354,8 @@ static const char *const msgs[] = { "conversion of negative constant to unsigned type, arg #%d", /* 296 */ "conversion to '%s' may sign-extend incorrectly, arg #%d", /* 297 */ "conversion from '%s' to '%s' may lose accuracy, arg #%d", /* 298 */ - "prototype does not match old style definition, arg #%d", /* 299 */ - "old style definition", /* 300 */ + "prototype does not match old-style definition, arg #%d", /* 299 */ + "old-style definition", /* 300 */ "array of incomplete type", /* 301 */ "'%s' returns pointer to automatic object", /* 302 */ "ANSI C forbids conversion of %s to %s", /* 303 */ Index: src/usr.bin/xlint/lint1/func.c diff -u src/usr.bin/xlint/lint1/func.c:1.144 src/usr.bin/xlint/lint1/func.c:1.145 --- src/usr.bin/xlint/lint1/func.c:1.144 Sun Aug 28 19:09:12 2022 +++ src/usr.bin/xlint/lint1/func.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: func.c,v 1.144 2022/08/28 19:09:12 rillig Exp $ */ +/* $NetBSD: func.c,v 1.145 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: func.c,v 1.144 2022/08/28 19:09:12 rillig Exp $"); +__RCSID("$NetBSD: func.c,v 1.145 2022/10/01 09:42:40 rillig Exp $"); #endif #include <stdlib.h> @@ -215,9 +215,9 @@ check_statement_reachable(void) /* * Called after a function declaration which introduces a function definition - * and before an (optional) old style argument declaration list. + * and before an (optional) old-style argument declaration list. * - * Puts all symbols declared in the prototype or in an old style argument + * Puts all symbols declared in the prototype or in an old-style argument * list back to the symbol table. * * Does the usual checking of storage class, type (return value), @@ -246,7 +246,7 @@ funcdef(sym_t *fsym) /* * In old_style_function() we did not know whether it is an old - * style function definition or only an old style declaration, + * style function definition or only an old-style declaration, * if there are no arguments inside the argument list ("f()"). */ if (!fsym->s_type->t_proto && fsym->u.s_old_style_args == NULL) @@ -293,7 +293,7 @@ funcdef(sym_t *fsym) /* * We must also remember the position. s_def_pos is overwritten - * if this is an old style definition and we had already a + * if this is an old-style definition and we had already a * prototype. */ dcs->d_func_def_pos = fsym->s_def_pos; Index: src/usr.bin/xlint/lint1/lint1.h diff -u src/usr.bin/xlint/lint1/lint1.h:1.157 src/usr.bin/xlint/lint1/lint1.h:1.158 --- src/usr.bin/xlint/lint1/lint1.h:1.157 Sun Aug 28 08:41:06 2022 +++ src/usr.bin/xlint/lint1/lint1.h Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: lint1.h,v 1.157 2022/08/28 08:41:06 rillig Exp $ */ +/* $NetBSD: lint1.h,v 1.158 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -229,10 +229,10 @@ typedef struct sym { bool s_used:1; /* variable/label used */ bool s_arg:1; /* symbol is function argument */ bool s_register:1; /* symbol is register variable */ - bool s_defarg:1; /* undefined symbol in old style function + bool s_defarg:1; /* undefined symbol in old-style function definition */ bool s_return_type_implicit_int:1; - bool s_osdef:1; /* symbol stems from old style function def. */ + bool s_osdef:1; /* symbol stems from old-style function def. */ bool s_inline:1; /* true if this is an inline function */ struct sym *s_ext_sym; /* for locally declared external symbols, the * pointer to the external symbol with the Index: src/usr.bin/xlint/lint1/tree.c diff -u src/usr.bin/xlint/lint1/tree.c:1.480 src/usr.bin/xlint/lint1/tree.c:1.481 --- src/usr.bin/xlint/lint1/tree.c:1.480 Sun Aug 28 19:09:12 2022 +++ src/usr.bin/xlint/lint1/tree.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: tree.c,v 1.480 2022/08/28 19:09:12 rillig Exp $ */ +/* $NetBSD: tree.c,v 1.481 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: tree.c,v 1.480 2022/08/28 19:09:12 rillig Exp $"); +__RCSID("$NetBSD: tree.c,v 1.481 2022/10/01 09:42:40 rillig Exp $"); #endif #include <float.h> @@ -3346,7 +3346,7 @@ build_colon(bool sys, tnode_t *ln, tnode /* * XXX For now we simply take the left type. This is * probably wrong, if one type contains a function prototype - * and the other one, at the same place, only an old style + * and the other one, at the same place, only an old-style * declaration. */ tp = merge_qualifiers(ln->tn_type, rn->tn_type); Index: src/usr.bin/xlint/lint2/chk.c diff -u src/usr.bin/xlint/lint2/chk.c:1.51 src/usr.bin/xlint/lint2/chk.c:1.52 --- src/usr.bin/xlint/lint2/chk.c:1.51 Sun Aug 28 12:04:47 2022 +++ src/usr.bin/xlint/lint2/chk.c Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -/* $NetBSD: chk.c,v 1.51 2022/08/28 12:04:47 rillig Exp $ */ +/* $NetBSD: chk.c,v 1.52 2022/10/01 09:42:40 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) -__RCSID("$NetBSD: chk.c,v 1.51 2022/08/28 12:04:47 rillig Exp $"); +__RCSID("$NetBSD: chk.c,v 1.52 2022/10/01 09:42:40 rillig Exp $"); #endif #include <ctype.h> @@ -112,7 +112,7 @@ chkname(const hte_t *hte) decl = sym; } - /* A prototype is better than an old style declaration. */ + /* A prototype is better than an old-style declaration. */ if (pdecl != NULL) decl = pdecl; @@ -441,9 +441,9 @@ chkfaui(const hte_t *hte, sym_t *def, sy * hte a pointer to the hash table entry of the function * n the number of the argument (1..) * def the function definition or NULL - * decl prototype declaration, old style declaration or NULL + * decl prototype declaration, old-style declaration or NULL * pos1p position of definition, declaration of first call - * call1 first call, if both def and decl are old style def/decl + * call1 first call, if both def and decl are old-style def/decl * call checked call * arg1 currently checked argument of def/decl/call1 * arg2 currently checked argument of call @@ -461,13 +461,13 @@ chkau(const hte_t *hte, int n, sym_t *de /* * If a function definition is available (def != NULL), we compare the * function call (call) with the definition. Otherwise, if a function - * definition is available and it is not an old style definition + * definition is available and it is not an old-style definition * (decl != NULL && TP(decl->s_type)->t_proto), we compare the call * with this declaration. Otherwise we compare it with the first * call we have found (call1). */ - /* arg1 must be promoted if it stems from an old style definition */ + /* arg1 must be promoted if it stems from an old-style definition */ promote = def != NULL && def->s_old_style_function; /* @@ -1147,7 +1147,7 @@ chkadecl(const hte_t *hte, sym_t *def, s return; /* - * XXX Prototypes should also be compared with old style function + * XXX Prototypes should also be compared with old-style function * declarations. */ @@ -1198,12 +1198,12 @@ chkadecl(const hte_t *hte, sym_t *def, s * ignqual if set, ignore qualifiers of outermost type; used for * function arguments * promote if set, promote left type before comparison; used for - * comparisons of arguments with parameters of old style + * comparisons of arguments with parameters of old-style * definitions * asgn left indirected type must have at least the same qualifiers * like right indirected type (for assignments and function * arguments) - * *dowarn set to true if an old style declaration was compared with + * *dowarn set to true if an old-style declaration was compared with * an incompatible prototype declaration */ static bool Index: src/usr.bin/xlint/xlint/lint.1 diff -u src/usr.bin/xlint/xlint/lint.1:1.54 src/usr.bin/xlint/xlint/lint.1:1.55 --- src/usr.bin/xlint/xlint/lint.1:1.54 Tue Jul 5 22:50:41 2022 +++ src/usr.bin/xlint/xlint/lint.1 Sat Oct 1 09:42:40 2022 @@ -1,4 +1,4 @@ -.\" $NetBSD: lint.1,v 1.54 2022/07/05 22:50:41 rillig Exp $ +.\" $NetBSD: lint.1,v 1.55 2022/10/01 09:42:40 rillig Exp $ .\" .\" Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. .\" Copyright (c) 1994, 1995 Jochen Pohl @@ -262,7 +262,7 @@ enum declarations, C++ -style .Dq // comments, zero sized structures, subscripting of non-lvalue arrays, prototypes -overriding old style function declarations and long long +overriding old-style function declarations and long long integer types. The .Fl g