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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

MISRA-C RulesIdentifiers5.15.25.35.45.55.65.7Types6.16.26.36.46.5(R)(R)(R)(R)(A)(A)(A)(R)(R)(A)(R)(R)Identifiers (internal and external) shall not rely on the significance of more than 31characters.Identifiers in an inner scope shall not use the same name as an identifier in an outerscope, and there<strong>for</strong>e hide that identifier.A typedef name shall be a unique identifier.A tag name shall be a unique identifier.No object or function identifier with static storage duration should be reused.No identifier in one name space should have the same spelling as an identifier inanother name space, with the exception of structure and union member names.No identifier name should be reused.The plain char type shall be used only <strong>for</strong> storage and use of character values.signed and unsigned char type shall be used only <strong>for</strong> the storage and use ofnumeric values.typedefs that indicate size and signedness should be used in place of the basictypes.Bit-fields shall only be defined to be of type unsigned int or signed int.Bit-fields of type signed int shall be at least 2 bits long.Constants7.1(R)Octal constants (other than zero) and octal escape sequences shall not be used.Declarations and definitions8.18.28.38.48.58.68.78.8(R)(R)(R)(R)(R)(R)(R)(R)Functions shall have prototype declarations and the prototype shall be visible at boththe function definition and call.Whenever an object or function is declared or defined, its type shall be explicitlystated.For each function parameter the type given in the declaration and definition shall beidentical, and the return types shall also be identical.If objects or functions are declared more than once their types shall be compatible.There shall be no definitions of objects or functions in a header file.Functions shall be declared at file scope.Objects shall be defined at block scope if they are only accessed from within a singlefunction.An external object or function shall be declared in one and only one file.869

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

Saved successfully!

Ooh no, something went wrong!