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

RULE-7-2: Incorrect detection of unsigned constants without suffix #705

Closed
lcartey opened this issue Sep 20, 2024 · 0 comments · Fixed by #706
Closed

RULE-7-2: Incorrect detection of unsigned constants without suffix #705

lcartey opened this issue Sep 20, 2024 · 0 comments · Fixed by #706
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-High

Comments

@lcartey
Copy link
Collaborator

lcartey commented Sep 20, 2024

Affected rules

  • RULE-7-2

Description

This query reports false positives in two cases:

  • It reports cases in macro expansions where the U suffix was used.
  • It reports cases where the integer constant is signed, but is then implicitly converted to unsigned. This is permitted by the rule.

Example

unsigned int x = 1030; // COMPLIANT[FALSE_POSITIVE]

#define Y 0x80000000U
Y; // COMPLIANT[FALSE_POSITIVE]
@lcartey lcartey added false positive/false negative An issue related to observed false positives or false negatives. Difficulty-Low A false positive or false negative report which is expected to take <1 day effort to address Impact-High labels Sep 20, 2024
@lcartey lcartey self-assigned this Sep 20, 2024
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-High
Projects
Development

Successfully merging a pull request may close this issue.

1 participant