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.

Chapter 20. MISRA-C RulesThis chapter contains an overview of the supported and unsupported MISRA C rules.20.1. MISRA-C:1998This section lists all supported and unsupported MISRA-C:1998 rules.See also Section 4.7.2, C Code Checking: MISRA-C.A number of MISRA-C rules leave room <strong>for</strong> interpretation. Other rules can only be checked in a limitedway. In such cases the implementation decisions and possible restrictions <strong>for</strong> these rules are listed.x means that the rule is not supported by the <strong>TASKING</strong> C compiler. (R) is a required rule, (A) is an advisoryrule.1.(R)The code shall con<strong>for</strong>m to standard C, without language extensions.x2.(A)Other languages should only be used with an interface standard.3.(A)Inline assembly is only allowed in dedicated C functions.x4.(A)Provision should be made <strong>for</strong> appropriate run-time checking.5.(R)Only use characters and escape sequences defined by ISO C.x6.(R)Character values shall be restricted to a subset of ISO 106460-1.7.(R)Trigraphs shall not be used.8.(R)Multibyte characters and wide string literals shall not be used.9.(R)Comments shall not be nested.10.(A)Sections of code should not be "commented out".In general, it is not possible to decide whether a piece of comment is C code that iscommented out, or just some pseudo code. Instead, the following heuristics are usedto detect possible C code inside a comment:• a line ends with ';', or• a line starts with '}', possibly preceded by white space11.(R)Identifiers shall not rely on significance of more than 31 characters.12.(A)The same identifier shall not be used in multiple name spaces.13.(A)Specific-length typedefs should be used instead of the basic types.14.(R)Use unsigned char or signed char instead of plain char.x15.(A)Floating-point implementations should comply with a standard.16.(R)The bit representation of floating-point numbers shall not be used.A violation is reported when a pointer to a floating-point type is converted to a pointerto an integer type.863

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

Saved successfully!

Ooh no, something went wrong!