Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelRFairhurst committed Sep 27, 2024
1 parent c8e5091 commit 8991e5f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
35 changes: 20 additions & 15 deletions c/common/test/rules/functionnoreturnattributecondition/test.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "setjmp.h"
#include "stdlib.h"
#include "threads.h"
#include "setjmp.h"

_Noreturn void test_noreturn_f1(int i) { // COMPLIANT
abort();
Expand Down Expand Up @@ -61,20 +61,25 @@ _Noreturn void test_noreturn_f9(int i) { // COMPLIANT
}

_Noreturn void test_noreturn_f10(int i) { // COMPLIANT
switch(i) {
case 0:
abort(); break;
case 1:
exit(0); break;
case 2:
_Exit(0); break;
case 3:
quick_exit(0); break;
case 4:
thrd_exit(0); break;
default:
jmp_buf jb;
longjmp(jb, 0);
switch (i) {
case 0:
abort();
break;
case 1:
exit(0);
break;
case 2:
_Exit(0);
break;
case 3:
quick_exit(0);
break;
case 4:
thrd_exit(0);
break;
default:
jmp_buf jb;
longjmp(jb, 0);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ query predicate problems(NoreturnFunction f, string message) {
mayReturn(f) and
not f.isCompilerGenerated() and
message =
"The function " + f.getName() + " declared with attribute " + describeNoreturn(f) + " returns a value."
"The function " + f.getName() + " declared with attribute " + describeNoreturn(f) +
" returns a value."
}

0 comments on commit 8991e5f

Please sign in to comment.