Lines Matching +full:non +full:- +full:comment
2 * Copyright 2007-2025 The OpenSSL Project Authors. All Rights Reserved.
3 * Copyright Siemens AG 2015-2022
12 * This demonstrates/tests cases where check-format.pl should report issues.
13 * Some of the reports are due to sanity checks for proper nesting of comment
14 * delimiters and parenthesis-like symbols, e.g., on unexpected/unclosed braces.
18 * The '@'s after leading '*' in comment lines are used for self-tests:
25 /* this line is between 81 and 100 chars long, to be reported with -strict-len */
29 /*@ intra-line carriage return character:
31 /*@ non-printable ASCII character: */
32 /*@ non-ASCII character: ä */
34 // /*@ end-of-line comment style not allowed (for C90 compatibility) */
35 /*@0 intra-line comment indent off by 1, reported unless sloppy-cmt */
36 /*X */ /*@2 missing spc or '*' after comment start reported unless sloppy-spc */
37 /* X*/ /*@ missing space before comment end , reported unless sloppy-spc */
38 /*@ comment starting delimiter: /* inside intra-line comment */
40 …*@ above multi-line comment start indent off by 1, reported unless sloppy-cmt; this comment line i…
41 *@ multi-line comment indent further off by 1 relative to comment start
42 *@ multi-line comment ending with text on last line */
43 /*@2 multi-line comment starting with text on first line
44 *@ comment starting delimiter: /* inside multi-line comment
45 *@ multi-line comment indent off by -1
46 *X*@ no spc after leading '*' in multi-line comment, reported unless sloppy-spc
47 *@0 more than two spaces after . in comment, no more reported
48 *@0 more than two spaces after ? in comment, no more reported
49 *@0 more than two spaces after ! in comment, no more reported
50 */ /*@ multi-line comment end indent off by -1 (relative to comment start) */
51 */ /*@ unexpected comment ending delimiter outside comment */
52 /*- '-' for formatted comment not allowed in intra-line comment */
53 /*@ comment line is toooooooooooo wide by 1 char, or by 21 chars in case strict-len option is used …
56 #define X (1 + 1) /*@0 extra space in body, reported unless sloppy-spc */
57 #define Y 1 /*@ extra space before body, reported unless sloppy-spc */ \
58 #define Z /*@2 preprocessor directive within multi-line directive */
59 typedef struct { /*@0 extra space in code, reported unless sloppy-spc */
60 enum { /*@1 extra space in intra-line comment, no more reported */
62 && 1, /*@ hanging expr indent off by 3, or -1 for leading '&&' */
63 x = 1, /*@ hanging expr indent off by -1 */
64 y,z /*@ no space after ',', reported unless sloppy-spc */
65 } e_member ; /*@ space before ';', reported unless sloppy-spc */
67 union { /*@ statement/type declaration indent off by -1 */
68 struct{} s; /*@ no space before '{', reported unless sloppy-spc */
69 }u_member; /*@ no space after '}', reported unless sloppy-spc */
71 int* somefunc(); /*@ no space before '*' in type decl, r unless sloppy-spc */
73 for (; ; ) ; /*@ space before ')', reported unless sloppy-spc */
74 for ( ; x; y) ; /*@2 space after '(' and before ';', unless sloppy-spc */
75 for (;;n++) { /*@ missing space after ';', reported unless sloppy-spc */
76 return; /*@0 (1-line) single statement in braces */
81 int f (int a, /*@ space after fn before '(', reported unless sloppy-spc */
82 int b, /*@ hanging expr indent off by -1 */
83 long I) /*@ single-letter name 'I' */
87 a] - /*@ unexpected closing bracket */
91 1* 1, /*@ no space etc. before '*', reported unless sloppy-spc */
97 s_type s; /*@2 local variable declaration indent off by -1 */
98 t_type t; /*@ local variable declaration indent again off by -1 */
100 somefunc(a, /*@2 statement indent off by -1 */
101 "aligned" /*@ expr indent off by -2 accepted if sloppy-hang */ "right"
102 , b, /*@ expr indent off by -1 */
103 b, /*@ expr indent as on line above, accepted if sloppy-hang */
104 b, /*@ expr indent off -8 but @ extra indent accepted if sloppy-hang */
105 "again aligned" /*@ expr indent off by -9 (left of stmt indent, */ "right",
106 … abc == /*@ .. so reported also with sloppy-hang; this line is too long by 6 or 26 chars */ 456
110 if(a /*@ missing space after 'if', reported unless sloppy-spc */
111 /*@0 intra-line comment indent off by -1 (not: by 3 due to '&&') */
112 && ! 0 /*@2 space after '!', reported unless sloppy-spc */
113 || b == /*@ hanging expr indent off by 2, or -2 for leading '||' */
114 (x<<= 1) + /*@ missing space before '<<=' reported unless sloppy-spc */
115 (xx+= 2) + /*@ missing space before '+=', reported unless sloppy-spc */
116 (a^ 1) + /*@ missing space before '^', reported unless sloppy-spc */
117 (y *=z) + /*@ missing space after '*=' reported unless sloppy-spc */
118 a %2 / /*@ missing space after '%', reported unless sloppy-spc */
119 1 +/* */ /*@ no space before comment, reported unless sloppy-spc */
120 /* */+ /*@ no space after comment, reported unless sloppy-spc */
121 s. e_member) /*@ space after '.', reported unless sloppy-spc */
122 xx = a + b /*@ extra single-statement indent off by 1 */
123 + 0; /*@ two times extra single-statement indent off by 3 */
124 if (a ++) /*@ space before postfix '++', reported unless sloppy-spc */
126 c; /*@0 single stmt in braces, reported on 1-stmt */
129 d; /*@0 single stmt in braces, reported on 1-stmt */
131 if (1) f(a, /*@ (non-brace) code after end of 'if' condition */
132 b); else /*@ (non-brace) code before 'else' */
133 do f(c, c); /*@ (non-brace) code after 'do' */
134 while ( 2); /*@ space after '(', reported unless sloppy-spc */
137 do{ /*@ missing space before '{', reported unless sloppy-spc */
139 f (3, /*@ space after fn before '(', reported unless sloppy-spc */
142 while (a+ 0); /*@2 missing space before '+', reported unless sloppy-spc */
143 switch (b ) { /*@ space before ')', reported unless sloppy-spc */
144 case 1: /*@ 'case' special statement indent off by -1 */
145 case(2): /*@ missing space after 'case', reported unless sloppy-spc */
147 } /*@ statement indent off by -4 */
148 return( /*@ missing space after 'return', reported unless sloppy-spc */
149 x); } /*@ code before block-level '}' */
354 ; /*@ 2 essentially blank lines before, if !sloppy-spc */
360 etyp /*@0 blank line follows just before EOF, if !sloppy-spc: */