Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit23f73a9

Browse files
committed
work
1 parenta331a62 commit23f73a9

File tree

2 files changed

+29
-0
lines changed
  • cpp/common/test/rules/nonvoidfunctiondoesnotreturn
  • c/common/test/rules/nonvoidfunctiondoesnotreturn

2 files changed

+29
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C++ TEST CASE AND
2+
// CHANGES SHOULD BE REFLECTED THERE AS WELL.
3+
#include<cstdlib>
4+
inttest_return_f1(inti) {// NON_COMPLIANT
5+
if (i>100) {
6+
returni;
7+
}
8+
}
9+
10+
inttest_return_f2(inti) {// COMPLIANT
11+
if (i>0) {
12+
returni;
13+
}else {
14+
return-i;
15+
}
16+
}
17+
18+
inttest_return_f3(inti) {}// NON_COMPLIANT
19+
20+
inttest_return_f5(inti) {// NON_COMPLIANT
21+
if (i>0) {
22+
returni;
23+
}
24+
if (i<0) {
25+
return-i;
26+
}
27+
}

‎cpp/common/test/rules/nonvoidfunctiondoesnotreturn/test.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// NOTICE: THE TEST CASES BELOW ARE ALSO INCLUDED IN THE C TEST CASE AND
2+
// CHANGES SHOULD BE REFLECTED THERE AS WELL.
13
#include<cstdlib>
24
inttest_return_f1(int i) {// NON_COMPLIANT
35
if (i >100) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp