Menu

FP: MISRA rule 8.4

mks004
2022-01-04
2022-01-20
  • mks004

    mks004 - 2022-01-04

    I am running into a suspected FP when checking this piece of code with Cppcheck 2.6 MISRA addon:

    extern void func1 ( void );
    
    void func1 ( void )
    {
      /* Compliant */
    }
    

    This is flagged as MISRA rule 8.4 violation:

    test.c:1:13: style: A compatible declaration shall be visible when an object or function with external linkage is defined [misra-c2012-8.4]
    extern void func1 ( void );
                ^
    

    However this code is an example of compliant code copied directly from MISRA standard section on rule 8.4.

     
  • Daniel Marjamäki

    hmm.. I can reproduce with cppcheck-2.6 but not with latest cppcheck git head.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.