-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parser: improve handling in nodeIsNoreturn to avoid false positives
- Loading branch information
1 parent
b504b35
commit 53d8b2c
Showing
3 changed files
with
52 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
int test(int a){ | ||
switch(a) { | ||
default: break; | ||
} | ||
return 1; | ||
} | ||
int test1(int a){ | ||
switch(a) { | ||
break; | ||
a=1; | ||
} | ||
return 1; | ||
} | ||
int test2(int a){ | ||
switch(a) { | ||
return 1; | ||
a=1; | ||
} | ||
return 1; | ||
} | ||
int compound_stmt(int a){ | ||
{ | ||
a=1; | ||
return 1; | ||
a=2; | ||
} | ||
} | ||
int if_then_else(int a){ | ||
if(a) | ||
return 1; | ||
else | ||
return 2; | ||
return 3; | ||
} | ||
#define EXPECTED_ERRORS "unreachable code.c:10:3: warning: unreachable code [-Wunreachable-code]" \ | ||
"unreachable code.c:17:3: warning: unreachable code [-Wunreachable-code]" \ | ||
"unreachable code.c:25:3: warning: unreachable code [-Wunreachable-code]" \ | ||
"unreachable code.c:33:2: warning: unreachable code [-Wunreachable-code]" |