mirror of
https://github.com/github/codeql.git
synced 2026-04-30 11:15:13 +02:00
C++: Add test case.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
| extraction_error.c:4:13:4:43 | my_function2_called_after_error | Static function my_function2_called_after_error is unreachable | extraction_error.c:4:13:4:43 | my_function2_called_after_error | my_function2_called_after_error |
|
||||
| extraction_error.c:5:13:5:35 | my_function3_not_called | Static function my_function3_not_called is unreachable | extraction_error.c:5:13:5:35 | my_function3_not_called | my_function3_not_called |
|
||||
| unused_functions.c:16:13:16:27 | unused_function | Static function unused_function is unreachable | unused_functions.c:16:13:16:27 | unused_function | unused_function |
|
||||
| unused_functions.c:20:13:20:28 | unused_function2 | Static function unused_function2 is unreachable ($@ must be removed at the same time) | unused_functions.c:24:13:24:28 | unused_function3 | unused_function3 |
|
||||
| unused_functions.c:24:13:24:28 | unused_function3 | Static function unused_function3 is unreachable | unused_functions.c:24:13:24:28 | unused_function3 | unused_function3 |
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// semmle-extractor-options: --expect_errors
|
||||
|
||||
static void my_function1_called() {} // GOOD
|
||||
static void my_function2_called_after_error() {} // GOOD [FALSE POSITIVE]
|
||||
static void my_function3_not_called() {} // BAD
|
||||
|
||||
int main(void) {
|
||||
my_function1_called();
|
||||
|
||||
--- compilation stops here because this line is not valid C code ---
|
||||
|
||||
my_function2_called_after_error();
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user