File tree Expand file tree Collapse file tree 3 files changed +35
-1
lines changed
cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 114 Expand file tree Collapse file tree 3 files changed +35
-1
lines changed Original file line number Diff line number Diff line change 3
3
| test.c:8:5:8:14 | declaration | Function f2 should return a value of type int but does not return a value here |
4
4
| test.c:25:9:25:14 | ExprStmt | Function f4 should return a value of type int but does not return a value here |
5
5
| test.c:39:9:39:14 | ExprStmt | Function f6 should return a value of type int but does not return a value here |
6
+ | test.c:117:5:117:10 | ExprStmt | Function f19 should return a value of type int but does not return a value here |
7
+ | test.c:123:5:123:10 | ExprStmt | Function f21 should return a value of type int but does not return a value here |
8
+ | test.c:135:5:135:10 | ExprStmt | Function f25 should return a value of type int but does not return a value here |
6
9
| test.cpp:16:1:18:1 | { ... } | Function g2 should return a value of type MyValue but does not return a value here |
7
10
| test.cpp:52:1:52:1 | return ... | Function g7 should return a value of type MyValue but does not return a value here |
8
11
| test.cpp:74:1:76:1 | { ... } | Function g10 should return a value of type second but does not return a value here |
Original file line number Diff line number Diff line change 1
- // semmle-extractor-options: -std=c11
1
+ // semmle-extractor-options: -std=c23
2
2
int f1 (void ) {
3
3
int x = 1 ;
4
4
return 2 ;
@@ -110,3 +110,27 @@ int f17() {
110
110
if (__builtin_expect (1 , 0 ))
111
111
__builtin_unreachable (); // GOOD
112
112
}
113
+
114
+ [[_Noreturn ]] void f18 ();
115
+
116
+ int f19 () {
117
+ f18 (); // GOOD
118
+ }
119
+
120
+ [[___Noreturn__ ]] void f20 ();
121
+
122
+ int f21 () {
123
+ f20 (); // GOOD
124
+ }
125
+
126
+ [[noreturn ]] void f22 ();
127
+
128
+ int f23 () {
129
+ f22 (); // GOOD
130
+ }
131
+
132
+ [[___noreturn__ ]] void f24 ();
133
+
134
+ int f25 () {
135
+ f24 (); // GOOD
136
+ }
Original file line number Diff line number Diff line change @@ -188,3 +188,10 @@ int g22() {
188
188
int g23 () {
189
189
Aborting ().a (); // GOOD [FALSE POSITIVE]
190
190
}
191
+
192
+ [[__noreturn__]]
193
+ int g24 ();
194
+
195
+ int g25 () {
196
+ g24 (); // GOOD
197
+ }
You can’t perform that action at this time.
0 commit comments