-2

I don't know problem in CPPcheck rule violation.

In funcs.h, I wrote code this way:

extern void fvCalcul_Speed(void) ;

In funcs.c

#include "funcs.h"

void fvCalcul_Speed(void)
{

    /*Declare*/
    // 1. Mot
    float rpm_Mot_v ;   //DW MISRA C(12.3)
    float vs_Mot_v ;
    static float rpm_Mot_v_Filt ;
}

I wrote code this way, but detect violation Rule 8.4 (A compatible declaration shall be visible when an object or function with external linkage is defined).

What's causing this problem?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
dw N
  • 1
  • 2
  • 1
    This code is conforming to rule 8.4 of MISRA C:2012. Your tool doesn't seem to know how to open the header file or is otherwise broken. Maybe cppcheck needs some setting to tell it to expand headers? I'm not familiar with it. – Lundin Aug 22 '23 at 09:53
  • Agree with @Lundin - there is no MISRA C:2012 Rule 8.4 violation in that code snippet. – Andrew Aug 23 '23 at 07:24

0 Answers0