Lines Matching +full:open +full:- +full:source
1 <!--
4 SPDX-License-Identifier: curl
5 -->
9 This is the tool we use within the curl project to scan C source code and
10 check that it adheres to our [Source Code Style guide](CODE_STYLE.md).
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
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
53 - `BANNEDFUNC`: A banned function was used. The functions sprintf, vsprintf,
54 strcat, strncat, gets are **never** allowed in curl source code.
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
141 - `COPYRIGHTYEAR`: the current changeset has not updated the copyright year in
142 the source file
144 - `STRERROR`: use of banned function strerror()
146 - `STDERR`: use of banned variable `stderr`
150 Due to the nature of the source code and the flaws of the `checksrc` tool,
156 You can control what to ignore within a specific source file by providing
157 instructions to `checksrc` in the source code itself. See examples below. The
161 Inline ignores are only done for that single specific source code file.
167 This ignores the warning for overly long lines until it is re-enabled with:
189 Make a `checksrc.skip` file in the directory of the source code with the