Mon Jul 3 10:14:31 2023 UTC ()
lint: remove redundant comments for command line flags


(rillig)
diff -r1.68 -r1.69 src/usr.bin/xlint/lint1/main1.c
diff -r1.60 -r1.61 src/usr.bin/xlint/xlint/lint.1

cvs diff -r1.68 -r1.69 src/usr.bin/xlint/lint1/main1.c (expand / switch to unified diff)

--- src/usr.bin/xlint/lint1/main1.c 2023/07/03 09:33:07 1.68
+++ src/usr.bin/xlint/lint1/main1.c 2023/07/03 10:14:31 1.69
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: main1.c,v 1.68 2023/07/03 09:33:07 rillig Exp $ */ 1/* $NetBSD: main1.c,v 1.69 2023/07/03 10:14:31 rillig Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994, 1995 Jochen Pohl 4 * Copyright (c) 1994, 1995 Jochen Pohl
5 * All Rights Reserved. 5 * All Rights Reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -27,94 +27,52 @@ @@ -27,94 +27,52 @@
27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 */ 32 */
33 33
34#if HAVE_NBTOOL_CONFIG_H 34#if HAVE_NBTOOL_CONFIG_H
35#include "nbtool_config.h" 35#include "nbtool_config.h"
36#endif 36#endif
37 37
38#include <sys/cdefs.h> 38#include <sys/cdefs.h>
39#if defined(__RCSID) 39#if defined(__RCSID)
40__RCSID("$NetBSD: main1.c,v 1.68 2023/07/03 09:33:07 rillig Exp $"); 40__RCSID("$NetBSD: main1.c,v 1.69 2023/07/03 10:14:31 rillig Exp $");
41#endif 41#endif
42 42
43#include <sys/types.h> 43#include <sys/types.h>
44#include <signal.h> 44#include <signal.h>
45#include <stdio.h> 45#include <stdio.h>
46#include <stdlib.h> 46#include <stdlib.h>
47#include <string.h> 47#include <string.h>
48#include <unistd.h> 48#include <unistd.h>
49 49
50#include "lint1.h" 50#include "lint1.h"
51 51
52/* set yydebug to 1*/ 
53bool yflag; 
54 
55/* 
56 * Print warnings if an assignment of an integer type to another integer type 
57 * causes an implicit narrowing conversion. If aflag is 1, these warnings 
58 * are printed only if the source type is at least as wide as long. If aflag 
59 * is greater than 1, they are always printed. 
60 */ 
61int aflag; 52int aflag;
62 
63/* Print a warning if a break statement cannot be reached. */ 
64bool bflag; 53bool bflag;
65 
66/* Print warnings for pointer casts. */ 
67bool cflag; 54bool cflag;
68 
69/* Perform stricter checking of enum types and operations on enum types. */ 
70bool eflag; 55bool eflag;
71 
72/* Print complete pathnames, not only the basename. */ 
73bool Fflag; 56bool Fflag;
74 
75/* Treat warnings as errors */ 
76bool wflag; 
77 
78/* 
79 * Apply a number of heuristic tests to attempt to intuit bugs, improve 
80 * style, and reduce waste. 
81 */ 
82bool hflag; 57bool hflag;
83 58bool Pflag;
84/* Attempt to check portability to other dialects of C. */ 
85bool pflag; 59bool pflag;
86 
87/* 
88 * In case of redeclarations/redefinitions print the location of the 
89 * previous declaration/definition. 
90 */ 
91bool rflag; 60bool rflag;
92 
93bool Tflag; 61bool Tflag;
94 
95/* Picky flag */ 
96bool Pflag; 
97 
98/* 
99 * Complain about functions and external variables used and not defined, 
100 * or defined and not used. 
101 */ 
102bool uflag = true; 62bool uflag = true;
103 
104/* Complain about unused function arguments. */ 
105bool vflag = true; 63bool vflag = true;
106 64bool wflag;
107/* Complain about structures which are never defined. */ 65bool yflag;
108bool zflag = true; 66bool zflag = true;
109 67
110/* 68/*
111 * The default language level is the one that checks for compatibility 69 * The default language level is the one that checks for compatibility
112 * between traditional C and C90. As of 2022, this default is no longer 70 * between traditional C and C90. As of 2022, this default is no longer
113 * useful since most traditional C code has already been migrated. 71 * useful since most traditional C code has already been migrated.
114 */ 72 */
115bool allow_trad = true; 73bool allow_trad = true;
116bool allow_c90 = true; 74bool allow_c90 = true;
117bool allow_c99; 75bool allow_c99;
118bool allow_c11; 76bool allow_c11;
119bool allow_c23; 77bool allow_c23;
120bool allow_gcc; 78bool allow_gcc;

cvs diff -r1.60 -r1.61 src/usr.bin/xlint/xlint/lint.1 (expand / switch to unified diff)

--- src/usr.bin/xlint/xlint/lint.1 2023/07/02 23:40:23 1.60
+++ src/usr.bin/xlint/xlint/lint.1 2023/07/03 10:14:31 1.61
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1.\" $NetBSD: lint.1,v 1.60 2023/07/02 23:40:23 rillig Exp $ 1.\" $NetBSD: lint.1,v 1.61 2023/07/03 10:14:31 rillig Exp $
2.\" 2.\"
3.\" Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. 3.\" Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
4.\" Copyright (c) 1994, 1995 Jochen Pohl 4.\" Copyright (c) 1994, 1995 Jochen Pohl
5.\" All Rights Reserved. 5.\" All Rights Reserved.
6.\" 6.\"
7.\" Redistribution and use in source and binary forms, with or without 7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions 8.\" modification, are permitted provided that the following conditions
9.\" are met: 9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright 10.\" 1. Redistributions of source code must retain the above copyright
11.\" notice, this list of conditions and the following disclaimer. 11.\" notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright 12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\" notice, this list of conditions and the following disclaimer in the 13.\" notice, this list of conditions and the following disclaimer in the
14.\" documentation and/or other materials provided with the distribution. 14.\" documentation and/or other materials provided with the distribution.
@@ -241,27 +241,27 @@ is defined as 1. @@ -241,27 +241,27 @@ is defined as 1.
241.It Fl d Ns Ar directory 241.It Fl d Ns Ar directory
242Use 242Use
243.Ar directory 243.Ar directory
244as the root directory 244as the root directory
245.Pq Va DESTDIR 245.Pq Va DESTDIR
246to find include files. 246to find include files.
247.It Fl e 247.It Fl e
248Complain about unusual operations on 248Complain about unusual operations on
249.Sy enum 249.Sy enum
250types and combinations of 250types and combinations of
251.Sy enum 251.Sy enum
252and integer types. 252and integer types.
253.It Fl F 253.It Fl F
254Print pathnames of files. 254Print pathnames of files, not only the basenames.
255.Nm 255.Nm
256normally prints the filename without the path. 256normally prints the filename without the path.
257.It Fl g 257.It Fl g
258Don't print warnings for some extensions of 258Don't print warnings for some extensions of
259.Xr gcc 1 259.Xr gcc 1
260to the C language. 260to the C language.
261Currently these are nonconstant initializers in automatic aggregate 261Currently these are nonconstant initializers in automatic aggregate
262initializations, arithmetic on pointer to void, trailing commas in 262initializations, arithmetic on pointer to void, trailing commas in
263enum declarations, C++ -style 263enum declarations, C++ -style
264.Dq // 264.Dq //
265comments, 265comments,
266zero sized structures, subscripting of non-lvalue arrays, prototypes 266zero sized structures, subscripting of non-lvalue arrays, prototypes
267overriding old-style function declarations and long long 267overriding old-style function declarations and long long