summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2001-02-09 14:37:35 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2001-02-09 14:37:35 +0000
commit0b0442ef52efd2a142b1932e8f4ea600164efd08 (patch)
tree828b774528b35b100f54ee8f974e1643a4b96c81
parent5ea89d6df273cdd541207f0e68acad74420c25ab (diff)
Some mdoc fixes.
-rw-r--r--usr.bin/xlint/xlint/lint.1148
1 files changed, 87 insertions, 61 deletions
diff --git a/usr.bin/xlint/xlint/lint.1 b/usr.bin/xlint/xlint/lint.1
index cf47fe1c5ab..32eef029383 100644
--- a/usr.bin/xlint/xlint/lint.1
+++ b/usr.bin/xlint/xlint/lint.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: lint.1,v 1.11 2001/02/09 03:23:07 aaron Exp $
+.\" $OpenBSD: lint.1,v 1.12 2001/02/09 14:37:34 aaron Exp $
.\" $NetBSD: lint.1,v 1.3 1995/10/23 13:45:31 jpo Exp $
.\"
.\" Copyright (c) 1994, 1995 Jochen Pohl
@@ -59,9 +59,8 @@
.Sh DESCRIPTION
.Nm
attempts to detect features of the named C program files
-that are likely to be bugs, to be non-portable, or to be
-wasteful. It also performs stricter type checking than
-the C compiler.
+that are likely to be bugs, non-portable, or wasteful.
+It also performs stricter type checking than the C compiler.
.Nm
runs the C preprocessor as its first phase, with the
preprocessor symbol
@@ -76,28 +75,30 @@ word for all code that is to be checked by
Among the possible problems that are currently noted are
unreachable statements, loops not entered at the top,
variables declared and not used, and logical expressions
-with constant values. Function calls are checked for
-inconsistencies, such as calls to functions that return
-values in some places and not in others, functions called
-with varying numbers of arguments, function calls that
-pass arguments of a type other than the type the function
-expects to receive, functions whose values are not used,
-and calls to functions not returning values that use
-the non-existent return value of the function.
+with constant values.
+Function calls are checked for inconsistencies, such as
+calls to functions that return values in some places and
+not in others, functions called with varying numbers of
+arguments, function calls that pass arguments of a type
+other than the type the function expects to receive,
+functions whose values are not used, and calls to functions
+not returning values that use the non-existent return value
+of the function.
.Pp
Filename arguments ending with
.Pa \&.c
-are taken to be C source files. Filename arguments with
-names ending with
+are taken to be C source files.
+Filename arguments with names ending with
.Pa \&.ln
are taken to be the result of an earlier invocation of
.Nm lint ,
with either the
.Fl i ,
-.Fl o
+.Fl o ,
or
.Fl C
-option in effect. The
+option in effect.
+The
.Pa \&.ln
files are analogous to the
.Pa \&.o
@@ -122,7 +123,8 @@ By default,
.Nm
appends the standard C lint library
.Pq Pa llib-lc.ln
-to the end of the list of files. When the
+to the end of the list of files.
+When the
.Fl i
option is used, the
.Pa \&.ln
@@ -133,19 +135,20 @@ or
.Fl i
options are used, the
.Pa llib-l Ns Ar library Ns Pa \&.ln
-files are ignored. When the
+files are ignored.
+When the
.Fl i
option is
.Em omitted
the second pass of
.Nm
-checks this list of files for mutual compatibility. At this point,
-if a complaint stems not from a given source file, but from one of
-its included files, the source filename will be printed followed by
-a question mark.
+checks this list of files for mutual compatibility.
+At this point, if a complaint stems not from a given source
+file, but from one of its included files, the source filename
+will be printed followed by a question mark.
.Pp
-.Sy Options
-.Bl -tag -width Fl
+The options are as follows:
+.Bl -tag -width Ds
.It Fl a
Report assignments of
.Sy long
@@ -161,8 +164,8 @@ cause implicit narrowing conversion.
.It Fl b
Report
.Sy break
-statements that cannot be reached. This is not the default
-because, unfortunately, most
+statements that cannot be reached.
+This is not the default because, unfortunately, most
.Xr lex 1
and many
.Xr yacc 1
@@ -179,11 +182,13 @@ and
.It Fl g
Don't print warnings for some extensions of
.Xr gcc 1
-to the C language. Currently these are nonconstant initializers in
+to the C language.
+Currently these are nonconstant initializers in
automatic aggregate initializations, arithmetic on pointer to void,
zero sized structures, subscripting of non-lvalue arrays, prototypes
overriding old style function declarations and long long
-integer types. The
+integer types.
+The
.Fl g
flag also turns on the keywords
.Sy asm
@@ -202,7 +207,8 @@ Produce a
.Pa \&.ln
file for every
.Pa \&.c
-file on the command line. These
+file on the command line.
+These
.Pa \&.ln
files are the product of
.Nm lint Ns 's
@@ -216,9 +222,11 @@ Attempt to check portability of code to other dialects of C.
In case of redeclarations report the position of the
previous declaration.
.It Fl s
-Strict ANSI C mode. Issue warnings and errors required by ANSI C.
+Strict ANSI C mode.
+Issue warnings and errors required by ANSI C.
Also do not produce warnings for constructs which behave
-differently in traditional C and ANSI C. With the
+differently in traditional C and ANSI C.
+With the
.Fl s
flag,
.Li __STRICT_ANSI__
@@ -226,14 +234,17 @@ is a predefined preprocessor macro.
.It Fl t
Traditional C mode.
.Li __STDC__
-is not predefined in this mode. Warnings are printed for constructs
-not allowed in traditional C. Warnings for constructs which behave
-differently in traditional C and ANSI C are suppressed. Preprocessor
-macros describing the machine type (e.g.,
+is not predefined in this mode.
+Warnings are printed for constructs not allowed in
+traditional C.
+Warnings for constructs which behave differently in
+traditional C and ANSI C are suppressed.
+Preprocessor macros describing the machine type (e.g.,
.Li sun3 Ns )
and machine architecture (e.g.,
.Li m68k Ns )
-are defined without leading and trailing underscores. The keywords
+are defined without leading and trailing underscores.
+The keywords
.Sy const Ns ,
.Sy volatile
and
@@ -265,7 +276,8 @@ This library is built from all
.Pa \&.c
and
.Pa \&.ln
-input files. After all global definitions of functions and
+input files.
+After all global definitions of functions and
variables in these files are written to the newly created library,
.Nm
checks all input files, including libraries specified with the
@@ -278,7 +290,8 @@ for
.Xr cpp 1 ,
as if by a
.Li #define
-directive. If no definition is given,
+directive.
+If no definition is given,
.Ar name
is defined as 1.
.It Fl I Ns Ar directory
@@ -308,16 +321,19 @@ Name the output file
.Ar outputfile .
The output file produced is the input that is given to
.Nm lint Ns 's
-second pass. The
+second pass.
+The
.Fl o
-option simply saves this file in the named output file. If the
+option simply saves this file in the named output file.
+If the
.Fl i
option is also used the files are not checked for compatibility.
To produce a
.Pa llib-l Ns Ar library Ns Pa \&.ln
without extraneous messages, use of the
.Fl u
-option is suggested. The
+option is suggested.
+The
.Fl v
option is useful if the source file(s) for the lint library
are just external interfaces.
@@ -361,8 +377,8 @@ suppress complaints about fall through to a
.Sy case
or
.Sy default
-labelled statement. This directive should be placed immediately
-preceding the label.
+labelled statement.
+This directive should be placed immediately preceding the label.
.It Li /* LINTLIBRARY */
At the beginning of a file, mark all functions and variables defined
in this file as
@@ -376,8 +392,11 @@ Also shut off complaints about unused function arguments.
.Li */
.Xc
Suppresses any intra-file warning except those dealing with
-unused variables or functions. This directive should be placed
-on the line immediately preceding where the lint warning occurred.
+unused variables or functions.
+This directive should be placed on the line immediately
+preceding where the
+.Nm
+warning occurred.
.It Li /* LONGLONG */
Suppress complaints about use of long long integer types.
.It Li /* NOTREACHED */
@@ -390,7 +409,8 @@ makes
.Nm
check the first
.Pq Ar n Ns No -1
-arguments as usual. The
+arguments as usual.
+The
.Ar n Ns No -th
argument is interpreted as a
.Sy printf
@@ -401,10 +421,11 @@ causes
to treat function declaration prototypes as function definitions
if
.Ar n
-is non-zero. This directive can only be used in conjunction with
-the
+is non-zero.
+This directive can only be used in conjunction with the
.Li /* LINTLIBRARY */
-directive. If
+directive.
+If
.Ar n
is zero, function prototypes will be treated normally.
.It Li /* SCANFLIKE Ns Ar n Li */
@@ -412,14 +433,16 @@ makes
.Nm
check the first
.Pq Ar n Ns No -1
-arguments as usual. The
+arguments as usual.
+The
.Ar n Ns No -th
argument is interpreted as a
.Sy scanf
format string that is used to check the remaining arguments.
.It Li /* VARARGS Ns Ar n Li */
Suppress the usual checking for variable numbers of arguments in
-the following function declaration. The data types of the first
+the following function declaration.
+The data types of the first
.Ar n
arguments are checked; a missing
.Ar n
@@ -432,17 +455,19 @@ and the
.Fl o
options allows for incremental use of
.Nm
-on a set of C source files. Generally, one invokes
+on a set of C source files.
+Generally, one invokes
.Nm
once for each source file with the
.Fl i
-option. Each of these invocations produces a
+option.
+Each of these invocations produces a
.Pa \&.ln
file that corresponds to the
.Pa \&.c
file, and prints all messages that are about just that
-source file. After all the source files have been separately
-run through
+source file.
+After all the source files have been separately run through
.Nm lint ,
it is invoked once more (without the
.Fl i
@@ -450,8 +475,9 @@ option), listing all the
.Pa \&.ln
files with the needed
.Fl l Ns Ar library
-options. this will print all the inter-file inconsistencies. This
-scheme works well with
+options.
+This will print all the inter-file inconsistencies.
+This scheme works well with
.Xr make 1 ;
it allows
.Xr make 1
@@ -465,8 +491,8 @@ time the set of source files were
.It Ev LIBDIR
the directory where the lint libraries specified by the
.Fl l Ns Ar library
-option must exist. If this environment variable is undefined,
-then the default path
+option must exist.
+If this environment variable is undefined, then the default path
.Pa /usr/libdata/lint
will be used to search for the libraries.
.It Ev TMPDIR
@@ -505,7 +531,7 @@ option will, when used in later
runs, cause certain errors that were reported when the libraries
were created to be reported again, and cause line numbers and file
names from the original source used to create those libraries
-to be reported in error messages. For these reasons, it is recommended
-to use the
+to be reported in error messages.
+For these reasons, it is recommended to use the
.Fl C
option to create lint libraries.