- Notifications
You must be signed in to change notification settings - Fork70
Fixing the final compatibility issues#338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
18 commits Select commitHold shift + click to select a range
84f9086 Correct errno headers.
lcartey3e2f72b Address string related compiler compatibility issues.
lcartey769ece5 A1-1-2: Add an options flag for clang
lcartey446ebfe A8-4-13: Fix compiler compatibility FPs
lcartey25bc94d Fixup stubs after changes to string and string.h
lcartey7e49686 A18-1-4: Fix compiler compatibility issues with reset
lcarteya1bf303 A20-8-1/MEM56-CPP: Fix compiler compat issues
lcarteybc122b7 Add a change note for A20-8-1/MEM56-CPP/A18-1-4.
lcartey089397a STR51-CPP: Address false negatives due to incomplete replace modelling
lcartey1f9a3b4 A15-5-1: Clarify message and handle implicit noexcept(true).
lcarteye70089f A18-5-5/A18-5-6: Make test case valid for gcc
lcarteyeb95419 CON50-CPP: Mutexes do not have destructors in most real libraries
lcartey6aaf0ee A15-2-2: Address compiler compatibility issue
lcartey14e4193 A16-2-2: Library includes are not useless on real compilers
lcarteyf283a38 fixes
jsinglet862c8fe Merge pull request #339 from github/jsinglet/lcartey-338-fix
lcarteyf6a9d30 A18-1-4: Address compiler compatibility issue
lcarteya24fca8 Merge branch 'lcartey/final-compiler-compat-issues' of github.com:git…
lcarteyFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletionschange_notes/2023-08-02-a8-4-13-false-positives.md
This file contains hidden or 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,2 @@ | ||
| - `A8-4-13` | ||
| - Address false positives caused by missing modelling of modifying operations for smart pointers for some standard libraries (such as libstdc++). |
5 changes: 5 additions & 0 deletionschange_notes/2023-08-02-smart-pointers.md
This file contains hidden or 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,5 @@ | ||
| - `A20-8-1`/`MEM56-CPP` | ||
| - Address false negatives caused by lack of modelling of flow through smart pointers. | ||
| - Reduce flow paths through standard library headers to simplify results. | ||
| - `A18-1-4` | ||
| - Address false positives caused by missing modelling of modifying operations for smart pointers for some standard libraries (such as libstdc++). |
2 changes: 2 additions & 0 deletionschange_notes/2023-08-03-string-replace.md
This file contains hidden or 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,2 @@ | ||
| - `STR51-CPP` | ||
| - Address false negatives caused by incomplete modelling of the `std::string::replace()` function. |
3 changes: 3 additions & 0 deletionschange_notes/2023-08-04-a15-5-1-noexcept.md
This file contains hidden or 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,3 @@ | ||
| - `A15-5-1` | ||
| - Rephrase alert message for `noalert(false)` special functions to clarify that this permits exceptions. | ||
| - Additional results for implicit `noexcept(true)` special functions highlighting that the specification should be made explicit. |
9 changes: 8 additions & 1 deletioncpp/autosar/src/rules/A15-2-2/ConstructorErrorLeavesObjectInInvalidState.ql
This file contains hidden or 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
16 changes: 13 additions & 3 deletionscpp/autosar/src/rules/A15-5-1/SpecialFunctionMissingNoExceptSpecification.ql
This file contains hidden or 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
27 changes: 19 additions & 8 deletionscpp/autosar/src/rules/A18-1-4/PointerToAnElementOfAnArrayPassedToASmartPointer.ql
This file contains hidden or 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
22 changes: 9 additions & 13 deletionscpp/autosar/src/rules/A8-4-13/SharedPtrPassedToFunctionWithImproperSemantics.ql
This file contains hidden or 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
1 change: 1 addition & 0 deletionscpp/autosar/test/rules/A1-1-2.3/options.clang
This file contains hidden or 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 @@ | ||
| -w |
2 changes: 1 addition & 1 deletioncpp/autosar/test/rules/A12-0-2/test.cpp
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #include <cstdlib> | ||
| #include <cstring> | ||
| class A { | ||
| public: | ||
22 changes: 11 additions & 11 deletionscpp/autosar/test/rules/A15-5-1/SpecialFunctionMissingNoExceptSpecification.expected
This file contains hidden or 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 |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| | test.cpp:5:3:5:9 | ~ClassA |Special functionClassA::~ClassAhas anoexcept(false) specification that permits exceptions. | | ||
| | test.cpp:9:3:9:9 | ~ClassB |Special functionClassB::~ClassBhas anoexcept(false) specification that permits exceptions. | | ||
| | test.cpp:38:6:38:20 | operator delete | operator deletehas an implicitnoexcept(true) specification but should make that explicit. | | ||
| | test.cpp:43:6:43:20 | operator delete | operator deletehas an implicitnoexcept(true) specification but should make that explicit. | | ||
| | test.cpp:53:11:53:19 | operator= |Special functionClassF::operator=has anoexcept(false) specification that permits exceptions. | | ||
| | test.cpp:63:3:63:8 | ClassH |Special functionClassH::ClassHhas anoexcept(false) specification that permits exceptions. | | ||
| | test.cpp:68:6:68:9 | swap |Special functionswaphas an implicitnoexcept(false)specification that permits exceptions. | | ||
| | test.cpp:72:6:72:9 | swap |Special function swap has anoexcept(false) specification that permits exceptions. | | ||
| | test.cpp:77:8:77:11 | swap |Special functionClassI::swaphas an implicitnoexcept(false)specification that permits exceptions. | | ||
| | test.cpp:82:8:82:11 | swap |Special functionClassJ::swaphas an implicitnoexcept(false)specification that permits exceptions. | | ||
| | test.cpp:88:6:88:6 | swap |Special functionswaphas an implicitnoexcept(false)specification that permits exceptions. | |
6 changes: 3 additions & 3 deletionscpp/autosar/test/rules/A15-5-1/test.cpp
This file contains hidden or 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
1 change: 1 addition & 0 deletionscpp/autosar/test/rules/A16-2-2/UnusedIncludeDirectives.expected.clang
This file contains hidden or 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 @@ | ||
| | test.cpp:1:1:1:19 | #include "test.hpp" | Nothing in this file uses anything from "test.hpp" | |
1 change: 1 addition & 0 deletionscpp/autosar/test/rules/A16-2-2/UnusedIncludeDirectives.expected.gcc
This file contains hidden or 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 @@ | ||
| | test.cpp:1:1:1:19 | #include "test.hpp" | Nothing in this file uses anything from "test.hpp" | |
1 change: 1 addition & 0 deletionscpp/autosar/test/rules/A16-2-2/UnusedIncludeDirectives.expected.qcc
This file contains hidden or 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 @@ | ||
| | test.cpp:1:1:1:19 | #include "test.hpp" | Nothing in this file uses anything from "test.hpp" | |
4 changes: 2 additions & 2 deletionscpp/autosar/test/rules/A16-2-2/test.cpp
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| #include "test.hpp" //NON_COMPLIANT | ||
| #include <algorithm> //NON_COMPLIANT - redundant but not useless on real compilers | ||
| #include <vector> //COMPLIANT | ||
| std::vector<int> v; |
2 changes: 1 addition & 1 deletioncpp/autosar/test/rules/A18-5-5/test.cpp
This file contains hidden or 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
2 changes: 1 addition & 1 deletioncpp/autosar/test/rules/A18-5-6/test.cpp
This file contains hidden or 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
2 changes: 1 addition & 1 deletioncpp/autosar/test/rules/M18-0-5/test.cpp
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include <cstring> | ||
| void test_unbounded_str_funs() { | ||
| char str1[] = "Sample string"; | ||
2 changes: 1 addition & 1 deletioncpp/cert/test/rules/EXP62-CPP/test.cpp
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include <cstring> | ||
| struct S1 { | ||
| int i, j, k; | ||
2 changes: 1 addition & 1 deletioncpp/cert/test/rules/OOP57-CPP/test.cpp
This file contains hidden or 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 |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| #include <cstring> | ||
| class trivial {}; | ||
17 changes: 16 additions & 1 deletioncpp/common/src/codingstandards/cpp/Concurrency.qll
This file contains hidden or 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
20 changes: 20 additions & 0 deletionscpp/common/src/codingstandards/cpp/SmartPointers.qll
This file contains hidden or 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
28 changes: 28 additions & 0 deletions...ntervaluestoredinunrelatedsmartpointer/OwnedPointerValueStoredInUnrelatedSmartPointer.qll
This file contains hidden or 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
6 changes: 5 additions & 1 deletion...s/preventdeadlockbylockinginpredefinedorder/PreventDeadlockByLockingInPredefinedOrder.qll
This file contains hidden or 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
3 changes: 2 additions & 1 deletioncpp/common/src/codingstandards/cpp/standardlibrary/String.qll
This file contains hidden or 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
4 changes: 2 additions & 2 deletionscpp/common/test/includes/standard-library/array
This file contains hidden or 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
3 changes: 1 addition & 2 deletionscpp/common/test/includes/standard-library/cerrno
This file contains hidden or 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 |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| #include <errno.h> |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.