MISRA.FUNC.PARAMS.IDENTIdentifiers used in declaration and definition of function are not identical. MISRA-C Rule 16.4 (required): The identifiers used in the declaration and definition of a function shall be identical.Functions shall be declared with a return type (see Rule 8.2), that type being void if the function does not return any data. Similarly, if the function has no parameters, the parameter list shall be declared as void. Thus for example, a function, 'myfunc', which neither takes parameters nor returns a value would be declared as: void myfunc ( void ); MISRA-C++ Rule 8-4-2 (required): The identifiers used for the parameters in a redeclaration of a function shall be identical to those in the declaration.This rule is also covered by MISRA.ADDR.REF.PARAM.PTR. RationaleThe name given to a parameter helps document the purpose of the parameter within the function body. If a function parameter is renamed in a subsequent re-declaration, then having different names for the same object will probably lead to developer confusion. Note that the rule also applies to any overriding set. ExceptionIt is not a violation of this rule if the declaration or re-declaration contains an unnamed parameter. Example// File1 void CreateRectangle ( uint32_t Height, uint32_t Width ); // File2 // Non-compliant void CreateRectangle ( uint32_t Width, uint32_t Height ); void fn1 ( int32_t a ); void fn2 ( int32_t ); void fn1 ( int32_t b ) // Non-compliant { } void fn2 ( int32_t b ) // Compliant { } |