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-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Difficulty-Medium A false positive or false negative report which is expected to take 1-5 days effort to address false positive/false negative An issue related to observed false positives or false negatives. Impact-Medium user-report Issue reported by an end user of CodeQL Coding Standards
Projects
None yet
Development

No branches or pull requests

1 participant