Albert Mathews - 2023-05-12

Hello,

I'm getting the following output:

cgsm.h:66:13: style: misra violation (use --rule-texts=<file> to get proper output) [misra-c2012-2.7]
extern void cgsm_initialize(cgsm_inputs_ptr_t);

I dont think I'm allowed to reprint the MISRA rules here, but essentially 2.7 says you cant have any unused argumennts. but what am I supposed to do in the case of a function declarartion which never uses its arguments?

throughout MISRA C 2012 doc i see example like :

extern void f1 ( char *s1 );

I have tried changing my code to resemble this like:

extern void cgsm_initialize(cgsm_inputs_ptr_t blah);

or

extern void cgsm_initialize(cgsm_inputs_ptr_t *blah);

but I still get the same rule violation.

can anyone help?

[Edit]: so the offending code in is a .h file. I have noticed that if i run Cppcheck on the .h file alone, not violation is reported. it's only when i run it on the .h and .c files together that the violation is reported.

 

Last edit: Albert Mathews 2023-05-12