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:
[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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I'm getting the following output:
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 :
I have tried changing my code to resemble this like:
or
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