-
Notifications
You must be signed in to change notification settings - Fork 68
Implement Conversions2
rule package
#946
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
.../rules/pointertoavirtualbaseclasscasttoapointer/PointerToAVirtualBaseClassCastToAPointer.qll
Outdated
Show resolved
Hide resolved
This shared implementation will be used for implementing MISRA C++ 2023 8.2.1.
MISRA C++ Rule 8.2.2 is similar, but not identical.
Nested macro invocations do not have getExpandedElements(), but do have getAffectedElements().
Detects C-style casts and functional notation casts that should be replaced with explicit cast operators. Prevents unsafe type conversions that lack clear intent and proper type checking constraints. [a]
Detects casts from integral, enumerated, or void pointer types to object pointer types that may lead to unspecified behavior. [a]
Detects casts that convert pointer types to integral types, which can make code harder to understand and may break pointer tracking in analysis tools. [a]
Detects pointer-to-integral casts that use types other than std::uintptr_t or std::intptr_t, which may not guarantee representation of all pointer values. [a]
Detects explicit type conversions using functional notation as standalone expression statements that create immediately-destroyed temporary objects. [a]
- Simplify the query implementation - Improve query message
- Remove redundant code - Use stripSpecifiers(..) to check for use of (u)intptr_t.
24a8098
to
6e9ee92
Compare
The code LGTM, however, we unfortunately have a performance issue in 8-2-2 evaluating |
Needless to say, I'll resolve the performance issue and merge. Thank you Luke! 😢 |
|
/test-performance |
🏁 Beep Boop! Performance testing for this PR has been initiated. Please check back later for results. Note that the query package generation step must complete before testing will start so it might be a minute. |
🏁 Beep Boop! Performance testing complete! See below for performance of the last 3 runs vs your PR. Times are based on predicate performance. You can find full graphs and stats in the PR that was created for this test in the release engineering repo.
🏁 Below are the slowest predicates for the last 2 releases vs this PR.
|
Adding @knewbury01 just to verify that this performance difference looks OK, and to review my contributed performance fix 0124f5e |
cc @jeongsoolee09 to stay in the loop regarding coding standards performance! |
Description
Follows on from #919.
Change request type
.ql
,.qll
,.qls
or unit tests)Rules with added or modified queries
RULE-8-2-1
RULE-8-2-2
RULE-8-2-6
RULE-8-2-7
RULE-8-2-8
RULE-1-3
RULE-23-3
RULE-23-5
RULE-23-6
Release change checklist
A change note (development_handbook.md#change-notes) is required for any pull request which modifies:
If you are only adding new rule queries, a change note is not required.
Author: Is a change note required?
🚨🚨🚨
Reviewer: Confirm that format of shared queries (not the .qll file, the
.ql file that imports it) is valid by running them within VS Code.
Reviewer: Confirm that either a change note is not required or the change note is required and has been added.
Query development review checklist
For PRs that add new queries or modify existing queries, the following checklist should be completed by both the author and reviewer:
Author
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.
Reviewer
As a rule of thumb, predicates specific to the query should take no more than 1 minute, and for simple queries be under 10 seconds. If this is not the case, this should be highlighted and agreed in the code review process.