Deviations from MISRA C Standards

The QTouch library was subjected to the above mentioned MISRA compliance rules. The following table lists the exceptions in the AT32UC3L QTouch library source code and also provides explanation for these exceptions.

Apart from these, there were many exceptions in the standard header files supplied by the tool chain and those are not captured here.

Rule

Rule Description

Advisory/Required

Exception noted / How it is addressed

1.1

All code shall conform to ISO 9899 standard C, with no extensions permitted.

Required

This Rule is not supported as the library implementation requires IAR extensions like __interrupt. These intrinsic functions relate to device hardware functionality, and cannot practically be avoided.

5.4

A tag name shall be a unique identifier

Required

This is violated as for the reason that enumerated types are mixed with other types. This is caused by integers being assigned to enumerated types in some places to save code space

6.3

The basic types of char, int, short, long, float, and double should not be used, but specific-length equivalents should be typedef'd for the specific compiler, and these type names used in the code

Advisory

The type bool supported by the compiler violate this rule.

10.3

The value of a complex expression of integer type shall only be cast to a type that is not wider and of the same signedness as the underlying type of the expression

Required

This is required in the code to do align some pointers in the data block memory. Cannot be avoided.

11.3

A cast should not be done between a pointer type and an integral type

Advisory

This is required in the code to do align some pointers in the data block memory. Cannot be avoided.

17.4

Array indexing shall be the only allowed form of pointer arithmetic

Required

Pointer increment has been done in some places for sequential access of signals, references, etc.

19.13

The # and ## preprocessor operators should not be used

Advisory

This is required for implementation of a macro for ease of use & abstraction