Skip to content

Commit 83abf99

Browse files
committed
[clang-tidy] Add additional test for cert-err33-c
Signed-off-by: Björn Svensson <[email protected]>
1 parent 923da2b commit 83abf99

File tree

1 file changed

+11
-0
lines changed
  • clang-tools-extra/test/clang-tidy/checkers/cert

1 file changed

+11
-0
lines changed

clang-tools-extra/test/clang-tidy/checkers/cert/err33-c.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,14 @@ void test_wscanf_s(void) {
2323
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: the value returned by this function should not be disregarded; neglecting it may lead to errors
2424
// CHECK-MESSAGES: [[@LINE-2]]:3: note: cast the expression to void to silence this warning
2525
}
26+
27+
int remove(const char *path);
28+
int removeNonStdLibFunc(const char *path);
29+
void test_remove(void) {
30+
remove("123");
31+
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: the value returned by this function should not be disregarded; neglecting it may lead to errors
32+
// CHECK-MESSAGES: [[@LINE-2]]:3: note: cast the expression to void to silence this warning
33+
removeNonStdLibFunc("123");
34+
// CHECK-MESSAGES: [[@LINE-1]]:3: warning: the value returned by this function should not be disregarded; neglecting it may lead to errors
35+
// CHECK-MESSAGES: [[@LINE-2]]:3: note: cast the expression to void to silence this warning
36+
}

0 commit comments

Comments
 (0)