Skip to content

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

Closed
@lcartey

Description

@lcartey

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]
}

Metadata

Metadata

Assignees

Labels

false positive/false negativeAn issue related to observed false positives or false negatives.false-negativeAn issue representing a false negative report.false-positiveAn issue representing a false positive report.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions