Skip to content

RULE-1-3: main functions are not correctly detected according to the standard #770

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

Closed
lcartey opened this issue Oct 21, 2024 · 0 comments · Fixed by #771
Closed

RULE-1-3: main functions are not correctly detected according to the standard #770

lcartey opened this issue Oct 21, 2024 · 0 comments · Fixed by #771
Assignees
Labels
false positive/false negative An issue related to observed false positives or false negatives. false-negative An issue representing a false negative report. false-positive An issue representing a false positive report.

Comments

@lcartey
Copy link
Collaborator

lcartey commented Oct 21, 2024

Affected rules

  • RULE-1-3

Description

The detection of standard-compliant main functions is broken:

  • Does not consider the valid use of typedefs.
  • Does not support the use of arrays instead of pointers for argv
  • Definition of the no-arg main is wrong - currently specified the return type should be void, when it should be int, and it should enforce that void is specified in the parameter list to declare no arguments.

Example

int main() { // NON_COMPLIANT[FALSE_NEGATIVE]
}

int main(int argc, char * argv[]) { // COMPLIANT[FALSE_POSITIVE]
}
@lcartey lcartey added false positive/false negative An issue related to observed false positives or false negatives. false-negative An issue representing a false negative report. false-positive An issue representing a false positive report. labels Oct 21, 2024
@lcartey lcartey self-assigned this Oct 21, 2024
@lcartey lcartey moved this from Reported to Ready for review in Coding Standards Public Development Board Oct 21, 2024
@github-project-automation github-project-automation bot moved this from Ready for review to Done in Coding Standards Public Development Board Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
false positive/false negative An issue related to observed false positives or false negatives. false-negative An issue representing a false negative report. false-positive An issue representing a false positive report.
Projects
Development

Successfully merging a pull request may close this issue.

1 participant