-
Notifications
You must be signed in to change notification settings - Fork 68
Closed
Labels
Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.An issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding StandardsIssue reported by an end user of CodeQL Coding Standards
Description
Affected rules
- RULE-8-7
Description
The query flags all functions that are called in only one unit, even if that unit is not the one where the function is defined. Technically, if we understand the term "referenced" as "called", this would indeed be a violation of the rule. But according to a MISRA official in this forum post, "referenced" should also include the definition of the function.
Example
Example taken from the forum post mentioned above. Here, bar() is flagged as a violation of the rule even if it is called from main.c.
/* foo.h*/
#ifndef FOO_H
#define FOO_H
extern void foo(void);
extern void bar(void);
#endif
/* foo.c*/
#include "foo.h"
void foo(void)
{
}
void bar(void)
{
foo();
}
/* main.c*/
#include "foo.h"
int main(void)
{
bar();
return 0;
}
Metadata
Metadata
Assignees
Labels
Difficulty-MediumA false positive or false negative report which is expected to take 1-5 days effort to addressA false positive or false negative report which is expected to take 1-5 days effort to addressImpact-Mediumfalse positive/false negativeAn issue related to observed false positives or false negatives.An issue related to observed false positives or false negatives.user-reportIssue reported by an end user of CodeQL Coding StandardsIssue reported by an end user of CodeQL Coding Standards
Type
Projects
Status
Done