Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

RULE-8-7: Flags functions that are called in only one unit, different than the unit it is defined in #864

Closed
Labels
Difficulty-MediumA 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.user-reportIssue reported by an end user of CodeQL Coding Standards
@picardb

Description

@picardb

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 inthis 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_Hextern 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

No one assigned

    Labels

    Difficulty-MediumA 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.user-reportIssue reported by an end user of CodeQL Coding Standards

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp