13.07.2015 Views

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

TASKING VX-toolset for ARM User Guide

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

MISRA-C RulesFunctions16.116.216.316.416.516.616.716.816.916.10(R)(R)(R)(R)(R)(R)(A)(R)(R)(R)Functions shall not be defined with variable numbers of arguments.Functions shall not call themselves, either directly or indirectly. A violation will bereported <strong>for</strong> direct or indirect recursive function calls in the source file being checked.Recursion via functions in other source files, or recursion via function pointers is notdetected.Identifiers shall be given <strong>for</strong> all of the parameters in a function prototype declaration.The identifiers used in the declaration and definition of a function shall be identical.Functions with no parameters shall be declared with parameter type void.The number of arguments passed to a function shall match the number of parameters.A pointer parameter in a function prototype should be declared as pointer to constif the pointer is not used to modify the addressed object.All exit paths from a function with non-void return type shall have an explicit returnstatement with an expression.A function identifier shall only be used with either a preceding &, or with aparenthesized parameter list, which may be empty.If a function returns error in<strong>for</strong>mation, then that error in<strong>for</strong>mation shall be tested. Aviolation is reported when the return value of a function is ignored.Pointers and arraysx17.1(R)Pointer arithmetic shall only be applied to pointers that address an array or arrayelement.x17.2(R)Pointer subtraction shall only be applied to pointers that address elements of thesame array.17.3(R)>, >=,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!