Skip to content

Commit 5bf2f56

Browse files
Revert "Address copilot review"
This reverts commit 9d539a3. The commit itself is good, but it should not be done in this branch.
1 parent 77487e6 commit 5bf2f56

File tree

9 files changed

+10
-6
lines changed

9 files changed

+10
-6
lines changed

.github/workflows/codeql_unit_tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- main
1616
- next
1717
- "rc/**"
18+
- michaelrfairhurst/package-undefined-behavior
1819

1920
jobs:
2021

.github/workflows/extra-rule-validation.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- main
1616
- "rc/**"
1717
- next
18+
- michaelrfairhurst/package-undefined-behavior
1819

1920

2021
jobs:

.github/workflows/tooling-unit-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515
- main
1616
- "rc/**"
1717
- next
18+
- michaelrfairhurst/package-undefined-behavior
1819

1920
jobs:
2021
prepare-supported-codeql-env-matrix:

.github/workflows/validate-package-files.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- main
1010
- next
1111
- "rc/**"
12+
- michaelrfairhurst/package-undefined-behavior
1213

1314
jobs:
1415
validate-package-files:

.github/workflows/validate-query-help.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- main
1010
- next
1111
- "rc/**"
12+
- michaelrfairhurst/package-undefined-behavior
1213

1314
jobs:
1415
validate-query-help-files:

.github/workflows/validate-query-test-case-formatting.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
- main
1010
- next
1111
- "rc/**"
12+
- michaelrfairhurst/package-undefined-behavior
1213

1314
env:
1415
XARGS_MAX_PROCS: 4

cpp/common/src/codingstandards/cpp/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ module PossibleDataRaceBetweenThreadsShared<PossibleDataRaceBetweenThreadsShared
3737
TStdFunctionCall(FunctionCall call) {
3838
call.getTarget()
3939
.hasName([
40-
"setlocale", "tmpnam", "rand", "srand", "getenv", "getenv_s", "strtok", "strerror",
40+
"setlocale", "tmpnam", "rand", "srand", "getenv", "getenv_s", "strok", "strerror",
4141
"asctime", "ctime", "gmtime", "localtime", "mbrtoc16", "c16rtomb", "mbrtoc32",
4242
"c32rtomb", "mbrlen", "mbrtowc", "wcrtomb", "mbsrtowcs", "wcsrtombs"
4343
])

cpp/common/test/rules/possibledataracebetweenthreadsshared/PossibleDataRaceBetweenThreadsShared.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
| test.cpp:93:3:93:6 | call to rand | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:93:3:93:6 | call to rand | rand | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:93:3:93:6 | call to rand | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
99
| test.cpp:94:3:94:11 | call to rand | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:94:3:94:11 | call to rand | rand | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:94:3:94:11 | call to rand | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1010
| test.cpp:96:3:96:8 | call to getenv | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:96:3:96:8 | call to getenv | getenv | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:96:3:96:8 | call to getenv | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
11-
| test.cpp:99:3:99:8 | call to strtok | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:99:3:99:8 | call to strtok | strtok | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:99:3:99:8 | call to strtok | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
12-
| test.cpp:100:3:100:13 | call to strtok | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:100:3:100:13 | call to strtok | strtok | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:100:3:100:13 | call to strtok | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1311
| test.cpp:101:3:101:10 | call to strerror | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:101:3:101:10 | call to strerror | strerror | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:101:3:101:10 | call to strerror | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1412
| test.cpp:102:3:102:15 | call to strerror | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:102:3:102:15 | call to strerror | strerror | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:102:3:102:15 | call to strerror | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |
1513
| test.cpp:103:3:103:9 | call to asctime | Threaded call to non-reentrant function $@ not synchronized from thread function $@ spawned from a loop. | test.cpp:103:3:103:9 | call to asctime | asctime | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs | test.cpp:103:3:103:9 | call to asctime | concurrent call to non-reentrant function | test.cpp:86:6:86:43 | many_thread13_calls_nonreentrant_funcs | many_thread13_calls_nonreentrant_funcs |

cpp/common/test/rules/possibledataracebetweenthreadsshared/test.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ void many_thread13_calls_nonreentrant_funcs(void *p) {
8989
// Not all are defined in std:: in our stubs.
9090
std::setlocale(LC_ALL, "C"); // NON-COMPLIANT
9191
setlocale(LC_ALL, "C"); // NON-COMPLIANT
92-
std::tmpnam(nullptr); // NON-COMPLIANT
92+
std::tmpnam(""); // NON-COMPLIANT
9393
rand(); // NON-COMPLIANT
9494
std::rand(); // NON-COMPLIANT
9595
// srand(0); // NON-COMPLIANT
9696
getenv("PATH"); // NON-COMPLIANT
9797
// std::getenv("PATH"); // NON-COMPLIANT
9898
////getenv_s(NULL, NULL, 0, NULL); // NON-COMPLIANT
99-
strtok("a", "b"); // NON-COMPLIANT
100-
std::strtok("a", "b"); // NON-COMPLIANT
99+
strtok("a", "b"); // NON-COMPLIANT[False negative]
100+
std::strtok("a", "b"); // NON-COMPLIANT[False negative]
101101
strerror(0); // NON-COMPLIANT
102102
std::strerror(0); // NON-COMPLIANT
103103
asctime(NULL); // NON-COMPLIANT

0 commit comments

Comments
 (0)