• Home
  • Raw
  • Download

Lines Matching +full:- +full:- +full:enable +full:- +full:warnings

1 <!--
4 SPDX-License-Identifier: curl
5 -->
18 `-W[file]` skip that file and exclude it from being checked. Helpful
21 `-D[dir]` directory name to prepend to filenames when accessing them.
23 `-h` shows the help output, that also lists all recognized warnings
33 checksrc.pl -h
35 Lists how to use the script and it lists all existing warnings it has and
37 warnings are:
39 - `ASSIGNWITHINCONDITION`: Assignment within a conditional expression. The
42 - `ASTERISKNOSPACE`: A pointer was declared like `char* name` instead of the
46 - `ASTERISKSPACE`: A pointer was declared like `char * name` instead of the
50 - `BADCOMMAND`: There is a bad `checksrc` instruction in the code. See the
51 **Ignore certain warnings** section below for details.
53 - `BANNEDFUNC`: A banned function was used. The functions sprintf, vsprintf,
56 - `BRACEELSE`: '} else' on the same line. The else is supposed to be on the
59 - `BRACEPOS`: wrong position for an open brace (`{`).
61 - `BRACEWHILE`: more than once space between end brace and while keyword
63 - `COMMANOSPACE`: a comma without following space
65 - `COPYRIGHT`: the file is missing a copyright statement
67 - `CPPCOMMENTS`: `//` comment detected, that is not C89 compliant
69 - `DOBRACE`: only use one space after do before open brace
71 - `EMPTYLINEBRACE`: found empty line before open brace
73 - `EQUALSNOSPACE`: no space after `=` sign
75 - `EQUALSNULL`: comparison with `== NULL` used in if/while. We use `!var`.
77 - `EXCLAMATIONSPACE`: space found after exclamations mark
79 - `FOPENMODE`: `fopen()` needs a macro for the mode string, use it
81 - `INDENTATION`: detected a wrong start column for code. Note that this
85 - `LONGLINE`: A line is longer than 79 columns.
87 - `MULTISPACE`: Multiple spaces were found where only one should be used.
89 - `NOSPACEEQUALS`: An equals sign was found without preceding space. We prefer
92 - `NOTEQUALSZERO`: check found using `!= 0`. We use plain `if(var)`.
94 - `ONELINECONDITION`: do not put the conditional block on the same line as `if()`
96 - `OPENCOMMENT`: File ended with a comment (`/*`) still "open".
98 - `PARENBRACE`: `){` was used without sufficient space in between.
100 - `RETURNNOSPACE`: `return` was used without space between the keyword and the
103 - `SEMINOSPACE`: There was no space (or newline) following a semicolon.
105 - `SIZEOFNOPAREN`: Found use of sizeof without parentheses. We prefer
108 - `SNPRINTF` - Found use of `snprintf()`. Since we use an internal replacement
111 - `SPACEAFTERPAREN`: there was a space after open parenthesis, `( text`.
113 - `SPACEBEFORECLOSE`: there was a space before a close parenthesis, `text )`.
115 - `SPACEBEFORECOMMA`: there was a space before a comma, `one , two`.
117 - `SPACEBEFOREPAREN`: there was a space before an open parenthesis, `if (`,
120 - `SPACESEMICOLON`: there was a space before semicolon, ` ;`.
122 - `TABS`: TAB characters are not allowed
124 - `TRAILINGSPACE`: Trailing whitespace on the line
126 - `TYPEDEFSTRUCT`: we frown upon (most) typedefed structs
128 - `UNUSEDIGNORE`: a `checksrc` inlined warning ignore was asked for but not
131 ### Extended warnings
133 Some warnings are quite computationally expensive to perform, so they are
134 turned off by default. To enable these warnings, place a `.checksrc` file in
135 the directory where they should be activated with commands to enable the
136 warnings you are interested in. The format of the file is to enable one
137 warning per line like so: `enable <EXTENDEDWARNING>`
139 Currently these are the extended warnings which can be enabled:
141 - `COPYRIGHTYEAR`: the current changeset has not updated the copyright year in
144 - `STRERROR`: use of banned function strerror()
146 - `STDERR`: use of banned variable `stderr`
148 ## Ignore certain warnings
151 there is sometimes a need to ignore specific warnings. `checksrc` allows a few
167 This ignores the warning for overly long lines until it is re-enabled with:
169 /* !checksrc! enable LONGLINE */