Skip to content
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

A3-9-1: Incorrectly alerts on template functions instantiated with fix-width integers #540

Open
rvermeulen opened this issue Feb 21, 2024 · 0 comments
Assignees
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards

Comments

@rvermeulen
Copy link
Collaborator

rvermeulen commented Feb 21, 2024

Affected rules

  • cpp/autosar/variable-width-integer-types-used

Description

Template instantiations store the template argument after type definitions have been resolved.
This results in argument types with variable width integer types even though the template is instantiated with fixed-width integers.

Additionally, we want to change the location of the alerts in case of template instantiations to the location where the template is instantiated because that is where the rule violation happens.

Example

template <typename T>
void foo(T value) { ... }
}
@rvermeulen rvermeulen added false positive/false negative An issue related to observed false positives or false negatives. Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards labels Feb 21, 2024
@rvermeulen rvermeulen self-assigned this Feb 21, 2024
@knewbury01 knewbury01 self-assigned this Jul 11, 2024
@knewbury01 knewbury01 moved this from Triaged to In Progress in Coding Standards Public Development Board Jul 11, 2024
@knewbury01 knewbury01 moved this from In Progress to Triaged in Coding Standards Public Development Board Jul 16, 2024
@lcartey lcartey added Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address and removed Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address labels Oct 18, 2024
@lcartey lcartey assigned lcartey and unassigned knewbury01 Oct 18, 2024
@lcartey lcartey moved this from Triaged to In Progress in Coding Standards Public Development Board Oct 18, 2024
rak3-sh added a commit to rak3-sh/codeql-coding-standards that referenced this issue Dec 18, 2024
github-merge-queue bot pushed a commit that referenced this issue Dec 28, 2024
Fix #540: A3-9-1: Dont consider variables from template instantiations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium Standard-AUTOSAR user-report Issue reported by an end user of CodeQL Coding Standards
Projects
Development

No branches or pull requests

4 participants