aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/Makefile6
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/au-misra3.lnt2173
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.h129
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.lnt209
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/gcc-include-path.lnt6
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cmac.h330
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cppmac.h336
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/size-options.lnt1
-rw-r--r--demos/STM32/RT-STM32F407-DISCOVERY/pclint/waivers.lnt42
-rw-r--r--os/common/ports/ARMCMx/devices/STM32F3xx/cmparams.h2
-rw-r--r--os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h2
-rw-r--r--os/rt/include/chbsem.h12
-rw-r--r--os/rt/include/chcond.h8
-rw-r--r--os/rt/include/chdebug.h28
-rw-r--r--os/rt/include/chdynamic.h12
-rw-r--r--os/rt/include/chevents.h22
-rw-r--r--os/rt/include/chheap.h10
-rw-r--r--os/rt/include/chmboxes.h9
-rw-r--r--os/rt/include/chmemcore.h8
-rw-r--r--os/rt/include/chmempools.h6
-rw-r--r--os/rt/include/chmsg.h6
-rw-r--r--os/rt/include/chmtx.h8
-rw-r--r--os/rt/include/chqueues.h26
-rw-r--r--os/rt/include/chregistry.h8
-rw-r--r--os/rt/include/chschd.h146
-rw-r--r--os/rt/include/chsem.h4
-rw-r--r--os/rt/include/chstats.h8
-rw-r--r--os/rt/include/chsys.h6
-rw-r--r--os/rt/include/chsystypes.h2
-rw-r--r--os/rt/include/chthreads.h14
-rw-r--r--os/rt/include/chtm.h6
-rw-r--r--os/rt/include/chvt.h17
-rw-r--r--os/rt/ports/ARM/compilers/GCC/chtypes.h2
-rw-r--r--os/rt/ports/ARMCMx/chcore.h12
-rw-r--r--os/rt/ports/ARMCMx/chcore_v6m.h72
-rw-r--r--os/rt/ports/ARMCMx/chcore_v7m.h112
-rw-r--r--os/rt/ports/ARMCMx/compilers/GCC/chtypes.h3
-rw-r--r--os/rt/ports/SIMIA32/compilers/GCC/chtypes.h2
-rw-r--r--os/rt/ports/e200/compilers/GCC/chtypes.h2
-rw-r--r--os/rt/src/chdebug.c6
-rw-r--r--os/rt/src/chdynamic.c5
-rw-r--r--os/rt/src/chqueues.c2
-rw-r--r--os/rt/src/chregistry.c4
-rw-r--r--os/rt/src/chschd.c43
-rw-r--r--os/rt/src/chstats.c4
-rw-r--r--os/rt/src/chsys.c42
-rw-r--r--os/rt/src/chthreads.c2
-rw-r--r--os/rt/src/chtm.c8
-rw-r--r--os/rt/src/chvt.c29
49 files changed, 3637 insertions, 315 deletions
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/Makefile b/demos/STM32/RT-STM32F407-DISCOVERY/Makefile
index 175b7d24d..5157ceaf7 100644
--- a/demos/STM32/RT-STM32F407-DISCOVERY/Makefile
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/Makefile
@@ -202,3 +202,9 @@ ULIBS =
RULESPATH = $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC
include $(RULESPATH)/rules.mk
+
+misra:
+ @echo Running PCLint
+ lint-nt -w1 pclint/co-gcc.lnt pclint/au-misra3.lnt pclint/waivers.lnt $(IINCDIR) $(KERNSRC) > misra.txt
+ @echo
+ @echo Done
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/au-misra3.lnt b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/au-misra3.lnt
new file mode 100644
index 000000000..c20ded95e
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/au-misra3.lnt
@@ -0,0 +1,2173 @@
+/* Date Stamp */ -d"_lint_au_misra3_lnt=au-misra3.lnt modified 12-Jun-2014"
+/* To document usage use: -message( "Using " _lint_au_misra3_lnt ) */
+
+// ---------------------------------------------------------------------
+// This file is provided by Gimpel Software (www.gimpel.com) for use with
+// its products PC-lint and FlexeLint.
+//
+// Redistribution and use of this file, with or without modification, is
+// permitted provided that any such redistribution retains this notice.
+// ---------------------------------------------------------------------
+
+// au-misra3.lnt -- Author options - MISRA C 2012
+
+/*
+ This options file can be used to explicitly activate those
+ checks advocated by the Motor Industry Software Reliability
+ Association.
+
+ You can use this file directly when linting your programs as in:
+
+ lin au-misra3 files
+
+ Gimpel Software relies on the document, "MISRA-C:2012
+ Guidelines for the use of the C language in critical systems",
+ copyright 2012 by MIRA Limited, as the primary source for this
+ file. Gimpel Software makes no warranty as to the completeness
+ or applicability of this options file and reserves the right to
+ amend or alter the official contents of such at any time.
+
+ "MISRA" is a registered trademark of MIRA Limited, held on
+ behalf of the MISRA Consortium.
+
+ */
+ -misra(3) // Activate MISRA Essential Type model
+
+/**** Dir 1.1 (Req) ************/
+
+ /* not statically checkable */
+
+/**** Dir 2.1 (Req) ************/
+
+ -A(C99) /* strict ISO C99 */
+ /* Note: if you code to the C90 standard instead, you may
+ want to comment out the above option and uncomment the
+ following option. You will also want to do likewise for
+ other uses of the '-A(C99)' option throughout this file. */
+ // -A(C90) /* strict ANSI */
+ +e950 /* flag non-standard word or construct */
+ +elib(950)
+ -append(950,[MISRA 2012 Directive 2.1, required])
+
+/**** Dir 3.1 (Req) ************/
+
+ /* not statically checkable */
+
+/**** Dir 4.1 (Req) ************/
+
+ /* not statically checkable */
+
+/**** Dir 4.2 (Adv) ************/
+
+ /* not statically checkable */
+
+/**** Dir 4.3 (Req) ************/
+
+ +e586 /* to activate the deprecation message */
+ +elib(586)
+ -deprecate(keyword,asm,[MISRA 2012 4.3, required])
+
+/**** Dir 4.4 (Adv) ************/
+
+ /* This requirement (that there be no commented-out code) is, in
+ principle, not statically checkable. The reason given for the
+ requirement is that comments do not nest. Thus a commented
+ out section of code that happens to use slash-star commenting
+ could inadvertently introduce unwanted code. Rule 3.1, however,
+ addresses the nested comment issue and hence the major concern
+ that this requirement seeks to address is indeed checkable.
+ */
+ -fnc /* flag nested comments */
+ +e602 /* comment within comment */
+ +elib(602)
+ -append(602,[MISRA 2012 Directive 4.4, advisory])
+
+/**** Dir 4.5 (Adv) ************/
+
+ // While Lint can enforce this directive with the following four
+ // options, doing so can increase the run time of Lint depending
+ // upon the number of identifiers in your program. If you want
+ // this checking, uncomment each of the following four options.
+ //
+ // +fta
+ // +e9046 /* typographical ambiguity */
+ // +elib(9046)
+ // -append(9046,[MISRA 2012 Directive 4.5, advisory])
+
+/**** Dir 4.6 (Adv) ************/
+
+ +e970 /* flag modifiers used outside of typedefs */
+ +elib(970)
+ -append(970,[MISRA 2012 Directive 4.6, advisory])
+ // For the duration, we are presuming MISRA does not want
+ // diagnostics for the bool type.
+ -esym(970,bool)
+ -esym(970,char)
+
+/**** Dir 4.7 (Req) ************/
+
+ +e534 /* ignoring return value of function */
+ +elib(534)
+ -append(534,[MISRA 2012 Directive 4.7, required])
+
+/**** Dir 4.8 (Adv) ************/
+
+ +e9045 /* non-hidden definition of type */
+ +elib(9045)
+ -append(9045,[MISRA 2012 Directive 4.8, advisory])
+
+/**** Dir 4.9 (Adv) ************/
+
+ +e9026 /* function-like macro defined */
+ +elib(9026)
+ -append(9026,[MISRA 2012 Directive 4.9, advisory])
+
+/**** Dir 4.10 (Req) ************/
+
+ +e451 /* Header repeatedly included without guard */
+ +elib(451)
+ -append(451,[MISRA 2012 Directive 4.10, required])
+
+/**** Dir 4.11 (Req) ************/
+
+ /* The arguments to over 100 calls to standard library functions
+ are monitored; users can specify additional constraints for
+ other functions.
+ */
+
+/**** Dir 4.12 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,calloc,[MISRA 2012 Directive 4.12, required])
+ -deprecate(function,malloc,[MISRA 2012 Directive 4.12, required])
+ -deprecate(function,realloc,[MISRA 2012 Directive 4.12, required])
+ -deprecate(function,free,[MISRA 2012 Directive 4.12, required])
+
+/**** Dir 4.13 (Adv) ************/
+
+ /* supported by uncommenting the next six options and use of the
+ -function_pair() option */
+ // +e480
+ // +elib(480)
+ // -append(480,[MISRA 2012 Directive 4.13, advisory])
+ // +e481
+ // +elib(481)
+ // -append(481,[MISRA 2012 Directive 4.13, advisory])
+
+/**** Rule 1.1 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ -A(C99) /* strict ISO C99 */
+ /* Note: if you code to the C90 standard instead, you may
+ want to comment out the above option and uncomment the
+ following option. You will also want to do likewise for
+ other uses of the '-A(C99)' option throughout this file. */
+ // -A(C90) /* strict ANSI */
+ +e950 /* flag non-standard word or construct */
+ +elib(950)
+ -append(950,[MISRA 2012 Rule 1.1, required])
+
+/**** Rule 1.2 (Adv) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ -A(C99) /* strict ISO C99 */
+ /* Note: if you code to the C90 standard instead, you may
+ want to comment out the above option and uncomment the
+ following option. You will also want to do likewise for
+ other uses of the '-A(C99)' option throughout this file. */
+ // -A(C90) /* strict ANSI */
+ +e950 /* flag non-ANSI word or construct */
+ +elib(950)
+ -append(950,[MISRA 2012 Rule 1.2, advisory])
+
+/**** Rule 1.3 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+
+ /* Avoid the use of undefined or unspecified behavior as described
+ in ISO C, Appendix A.6.1 and Appendix A.6.2 */
+
+ /* Source file not ending in a new-line character, ending in
+ new-line character immediately preceded by a backslash
+ character, or ending in a partial preprocessing token or
+ comment (ISO C, Appendix A.6.2, point 1).
+ */
+ +e406 /* unclosed comment */
+ +elib(406)
+ -append(406,[MISRA 2012 Rule 1.3, required])
+
+ /* Non-standard character usage (ISO C, Appendix A.6.2, point 2).
+ */
+ +e27 /* illegal character */
+ +elib(27)
+ -append(27,[MISRA 2012 Rule 1.3, required])
+
+ /* Unclosed quotes (ISO C, Appendix A.6.2, point 4).
+ */
+ +e2 /* unclosed quote */
+ +elib(2)
+ -append(2,[MISRA 2012 Rule 1.3, required])
+
+ /* Repeated label within a function (ISO C, Appendix A.6.2, point
+ 5).
+ */
+ +e31 /* symbol redefinition */
+ +elib(31)
+ -append(31,[MISRA 2012 Rule 1.3, required])
+
+ /* Non-visible identifier used (ISO C, Appendix A.6.2, point 6).
+ */
+ +e40 /* undeclared identifier */
+ +elib(40)
+ -append(40,[MISRA 2012 Rule 1.3, required])
+
+ /* Identifiers for the same entity differ beyond the minimal
+ significant characters (ISO C, Appendix A.6.2, point 7).
+ See Rules 5.1, 5.2, 5.4, and 5.5.
+ */
+
+ /* The same identifier has both internal and external linkage in
+ the same translation unit (ISO C, Appendix A.6.2, point 8).
+ */
+ +e401 /* symbol not previously declared static */
+ +elib(401)
+ -append(401,[MISRA 2012 Rule 1.3, required])
+
+ /* Multiple definitions for the same externally linked identifier
+ (ISO C, Appendix A.6.2, point 9).
+ */
+ +e31 /* symbol redefinition */
+ +elib(31)
+
+ /* Using automatic storage data via a pointer after the data's
+ lifetime (ISO C, Appendix A.6.2, point 10).
+ */
+ +e604 /* returning address of auto variable */
+ +elib(604)
+ -append(604,[MISRA 2012 Rule 1.3, required])
+ +e934 /* taking address of near auto variable */
+ +elib(934)
+ -append(934,[MISRA 2012 Rule 1.3, required])
+
+ /* Incompatible redeclarations (ISO C, Appendix A.6.2, point 11).
+ See Rule 8.3
+ */
+
+ /* Non-standard escape sequence (ISO C, Appendix A.6.2, point 12).
+ */
+ +e606 /* non-ANSI escape sequence */
+ +elib(606)
+ -append(606,[MISRA 2012 Rule 1.3, required])
+
+ /* Non-standard character in header name (ISO C, Appendix A.6.2,
+ point 15).
+ See Rule 20.2
+ */
+ +e9020 /* header name with non-standard character */
+ +elib(9020)
+ -append(9020,[MISRA 2012 Rule 1.3, required])
+
+ /* No complete type available (ISO C, Appendix A.6.2, point 16).
+ */
+ +e86 /* structure has no data elements */
+ +elib(86)
+ -append(86,[MISRA 2012 Rule 1.3, required])
+
+ /* Using or converting a void expression (ISO C, Appendix A.6.2,
+ point 17).
+ */
+ +e64 /* type mismatch */
+ +elib(64)
+ -append(64,[MISRA 2012 Rule 1.3, required])
+ +e67 /* cannot cast between types */
+ +elib(67)
+ -append(67,[MISRA 2012 Rule 1.3, required])
+ +e144 /* non-existent return value */
+ +elib(144)
+ -append(144,[MISRA 2012 Rule 1.3, required])
+
+ /* Modifying an object more than once or modifying and accessing
+ between two sequence points (ISO C, Appendix A.6.2, point 18).
+ See Rule 13.2
+ */
+ +e564 /* variable depends on order of evaluation */
+ +elib(564)
+ -append(564,[MISRA 2012 Rule 1.3, required])
+
+ /* Invalid arithmetic operations or unrepresentable results
+ (ISO C, Appendix A.6.2, point 19).
+ */
+ +e54 /* division by 0 */
+ +elib(54)
+ -append(54,[MISRA 2012 Rule 1.3, required])
+ +e414 /* possible division by 0 */
+ +elib(414)
+ -append(414,[MISRA 2012 Rule 1.3, required])
+ +e795 /* conceivable division by 0 */
+ +elib(795)
+ -append(795,[MISRA 2012 Rule 1.3, required])
+ /* Also, see Rule 12.4 */
+
+ /* Passing a void argument to a function (ISO C, Appendix A.6.2,
+ point 20).
+ */
+ +e64 /* type mismatch */
+ +elib(64)
+
+ /* Incompatible function redeclaration (ISO C, Appendix A.6.2,
+ point 22).
+ See Rule 8.3
+ */
+
+ /* An invalid array reference, null pointer reference, or
+ reference to an object declared with automatic storage duration in
+ a terminated block occurs (ISO C, Appendix A.6.2, point 24).
+ */
+ +e64 /* type mismatch */
+ +elib(64)
+ +e413 /* likely use of null pointer */
+ +elib(413)
+ -append(413,[MISRA 2012 Rule 1.3, required])
+ +e415 /* out-of-bounds pointer */
+ +elib(415)
+ -append(415,[MISRA 2012 Rule 1.3, required])
+ +e416 /* out-of-bounds pointer */
+ +elib(416)
+ -append(416,[MISRA 2012 Rule 1.3, required])
+ +e428 /* negative subscript */
+ +elib(428)
+ -append(428,[MISRA 2012 Rule 1.3, required])
+ /* Also, see Rule 17.6 */
+
+ /* A pointer to a function is converted to a pointer to an object
+ or a pointer to an object is converted to a pointer to a function
+ (ISO C, Appendix A.6.2, point 26).
+ */
+ +e64 /* type mismatch */
+ +elib(64)
+ +e740 /* unusual pointer cast */
+ +elib(740)
+ -append(740,[MISRA 2012 Rule 1.3, required])
+ /* Also, see Rule 11.1 and 11.2 */
+
+ /* A pointer is converted to other than an integral or pointer
+ type (ISO C, Appendix A.6.2, point 27).
+ */
+ +e64 /* type mismatch */
+ +elib(64)
+ +e71 /* cannot cast */
+ +elib(71)
+
+ /* An expression is shifted by a negative number or by an amount
+ greater than or equal to the width in bits of the expression being
+ shifted (ISO C, Appendix A.6.2, point 30).
+ */
+ +e504 /* unusual shift */
+ +elib(504)
+ -append(504,[MISRA 2012 Rule 1.3, required])
+
+ /* An identifier for an object is declared with no linkage and the
+ type of the object is incomplete after its declarator, or after its
+ init-declarator if it has an initializer (ISO C, Appendix
+ A.6.2, point 33).
+ */
+ +e86 /* structure has no data elements */
+ +elib(86)
+
+ /* Declaring a function at block scope with a storage-class
+ specifier other than extern (ISO C, Appendix A.6.2, point 34).
+ */
+ +e629 /* static class for function */
+ +elib(629)
+ -append(629,[MISRA 2012 Rule 1.3, required])
+
+ /* A bit-field is declared with a type other than int, signed int,
+ or unsigned int (ISO C, Appendix A.6.2, point 35).
+ See Rule 6.1.
+ */
+
+ /* Attempting to modify an object with const-qualified type by
+ means of an lvalue with non-const-qualified type (ISO C,
+ Appendix A.6.2, point 36).
+ */
+ +e158 /* assignment increases capability */
+ +elib(158)
+ -append(158,[MISRA 2012 Rule 1.3, required])
+
+ /* Attempting to refer to an object with volatile-qualified type
+ by means of an lvalue with non-volatile-qualified type (ISO C,
+ Appendix A.6.2, point 37).
+ */
+ +e158 /* assignment increases capability */
+ +elib(158)
+
+ /* Using the value of uninitialized automatic object (ISO C,
+ Appendix A.6.2, point 38).
+ See Rule 9.1
+ */
+
+ /* An object with aggregate or union type with static storage
+ duration has a non-brace-enclosed initializer, or an object
+ with aggregate or union type with automatic storage duration
+ has either a single expression initializer with a type other
+ than that of the object or a non-brace-enclosed initializer
+ (ISO C, Appendix A.6.2, point 39).
+ Also, see Rule 9.2
+ */
+ +e64 /* type mismatch */
+ +elib(64)
+
+ /* The value of a function is used, but no value was returned
+ (ISO C, Appendix A.6.2, point 40).
+ See Rule 17.4.
+ */
+
+ /* A function that accepts a variable number of arguments is
+ defined without a parameter type list that ends with the
+ ellipsis notation (ISO C, Appendix A.6.2, point 41).
+ */
+
+ /* An identifier for an object with internal linkage and an
+ incomplete type is declared with a tentative definition (ISO C,
+ Appendix A.6.2, point 42).
+ */
+ +e86 /* structure has no data elements */
+ +elib(86)
+
+ /* Non-standard #include preprocessing directive (ISO C, Appendix
+ A.6.2, point 44).
+ See Rule 20.3.
+ */
+
+ /* Non-standard #line directive (ISO C, Appendix A.6.2, point 49).
+ */
+ +"estring(10,a numeric constant)" /* expecting a numeric constant */
+
+ /* #defining or #undefing any of: defined, __LINE__, __FILE__,
+ __DATE__, __TIME__, or __STDC__ (ISO C, Appendix A.6.2, point 50).
+ */
+ +e136 /* illegal macro name */
+ +elib(136)
+ -append(136,[MISRA 2012 Rule 1.3, required])
+
+ /* Format-argument mismatch in an fprintf or fscanf type of
+ function (ISO C, Appendix A.6.2, point 75).
+ */
+ +e558 /* too few arguments */
+ +elib(558)
+ -append(558,[MISRA 2012 Rule 1.3, required])
+ +e719 /* too many arguments */
+ +elib(719)
+ -append(719,[MISRA 2012 Rule 1.3, required])
+
+ /* A %% conversion specification for the fprintf or fscanf
+ function contains characters between the pair of % characters
+ (ISO C, Appendix A.6.2, point 77).
+ */
+ +e557 /* unrecognized format */
+ +elib(557)
+ -append(557,[MISRA 2012 Rule 1.3, required])
+
+ /* An aggregate or union, or a pointer to an aggregate or union is
+ an argument to the fprintf function, except for the conversion
+ specifiers %s (for an array of character type) or %p (for a pointer
+ to void) (ISO C, Appendix A.6.2, point 81).
+ */
+ +e437 /* passing struct to ellipsis */
+ +elib(437)
+ -append(437,[MISRA 2012 Rule 1.3, required])
+
+ /* Referring to deallocated space (ISO C, Appendix A.6.2, point
+ 87).
+ */
+ +e449 /* previously deallocated pointer */
+ +elib(449)
+ -append(449,[MISRA 2012 Rule 1.3, required])
+
+ /* Misuse of free or realloc (ISO C, Appendix A.6.2, point 88).
+ */
+ +esym(424,free) /* inappropriate deallocation */
+ -append(424,[MISRA 2012 Rule 1.3, required])
+
+ /* An array written to by a copying or concatenation function is
+ too small (ISO C, Appendix A.6.2, point 91).
+ */
+ +e419 /* data overrun */
+ +elib(419)
+ -append(419,[MISRA 2012 Rule 1.3, required])
+
+ /* Order of evaluation (ISO C, Appendix A.6.1, point 7).
+ */
+ +e564 /* variable depends on order of evaluation */
+ +elib(564)
+ -append(564,[MISRA 2012 Rule 1.3, required])
+
+ /* Side effects order (ISO C, Appendix A.6.1, point 8).
+ */
+ +e931 /* both sides of an expression have side-effects */
+ +elib(931)
+ -append(931,[MISRA 2012 Rule 1.3, required])
+
+ /* Function argument evaluation (ISO C, Appendix A.6.1, point 9).
+ */
+ +e564 /* variable depends on order of evaluation */
+ +elib(564)
+
+ /* The order in which # and ## operations are evaluated during
+ macro substitution (ISO C, Appendix A.6.1, point 12).
+ */
+ +e9023 /* multiple '#/##' operators in macro definition */
+ +elib(9023)
+ -append(9023,[MISRA 2012 Rule 1.3, required])
+
+ /* Whether setjmp is a macro or an external identifier (ISO C,
+ Appendix A.6.1, point 14).
+ See Rule 21.2.
+ */
+
+/**** Rule 2.1 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e506 /* constant value boolean */
+ +elib(506)
+ -append(506,[MISRA 2012 Rule 2.1, required])
+ +e527 /* unreachable */
+ +elib(527)
+ -append(527,[MISRA 2012 Rule 2.1, required])
+ +e681 /* loop not entered */
+ +elib(681)
+ -append(681,[MISRA 2012 Rule 2.1, required])
+ +e827 /* loop not reachable */
+ +elib(827)
+ -append(827,[MISRA 2012 Rule 2.1, required])
+
+/**** Rule 2.2 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e438 /* value not used */
+ +elib(438)
+ -append(438,[MISRA 2012 Rule 2.2, required])
+ +e505 /* redundant argument to comma */
+ +elib(505)
+ -append(505,[MISRA 2012 Rule 2.2, required])
+ +e520 /* highest operator has no side effects */
+ +elib(520)
+ -append(520,[MISRA 2012 Rule 2.2, required])
+ +e521 /* highest operator has no side effects */
+ +elib(521)
+ -append(521,[MISRA 2012 Rule 2.2, required])
+ +e522 /* highest operator has no side effects */
+ +elib(522)
+ -append(522,[MISRA 2012 Rule 2.2, required])
+
+/**** Rule 2.3 (Adv) ************/
+
+ +e751 /* local typedef not referenced */
+ +elib(751)
+ -append(751,[MISRA 2012 Rule 2.3, advisory])
+ +e756 /* global not referenced */
+ +elib(756)
+ -append(756,[MISRA 2012 Rule 2.3, advisory])
+
+/**** Rule 2.4 (Adv) ************/
+
+ +e753 /* local tag not referenced */
+ +elib(753)
+ -append(753,[MISRA 2012 Rule 2.4, advisory])
+ +e9058
+ +elibsym(9058)
+ -append(9058,[MISRA 2012 Rule 2.4, advisory])
+
+/**** Rule 2.5 (Adv) ************/
+
+ +e750 /* local macro not referenced */
+ +elib(750)
+ -append(750,[MISRA 2012 Rule 2.5, advisory])
+ +e755 /* global macro not referenced */
+ +elib(755)
+ -append(755,[MISRA 2012 Rule 2.5, advisory])
+
+/**** Rule 2.6 (Adv) ************/
+
+ +e563 /* label not referenced */
+ +elib(563)
+ -append(563,[MISRA 2012 Rule 2.6, advisory])
+
+/**** Rule 2.7 (Adv) ************/
+
+ +e715 /* not referenced */
+ +elib(715)
+ -append(715,[MISRA 2012 Rule 2.7, advisory])
+
+/**** Rule 3.1 (Req) ************/
+
+ -fnc /* flag nested comments */
+ +e602 /* comment within comment */
+ +elib(602)
+ -append(602,[MISRA 2012 Rule 3.1, required])
+ +e9059
+ +elib(9059)
+ -append(9059,[MISRA 2012 Rule 3.1, required])
+ +e9066
+ +elib(9066)
+ -append(9066,[MISRA 2012 Rule 3.1, required])
+
+/**** Rule 3.2 (Req) ************/
+
+ +e427 /* C++ comment ends in \\ */
+ +elib(427)
+ -append(427,[MISRA 2012 Rule 3.2, required])
+
+/**** Rule 4.1 (Req) ************/
+
+ +e9039 /* prohibited escape sequence */
+ +elib(9039)
+ -append(9039,[MISRA 2012 Rule 4.1, required])
+
+/**** Rule 4.2 (Adv) ************/
+
+ -ftg /* inhibit use of trigraphs */
+ +e584 /* activate trigraph detected message */
+ +elib(584)
+ -append(584,[MISRA 2012 Rule 4.2, advisory])
+ +e739 /* activate trigraph in string message */
+ +elib(739)
+ -append(739,[MISRA 2012 Rule 4.2, advisory])
+ +e9060 /* trigraph in comment */
+ +elib(9060)
+ -append(9060,[MISRA 2012 Rule 4.2, advisory])
+
+/**** Rule 5.1 (Req) ************/
+
+ -idlen(31) /* flag names identical in the first 31 characters */
+ +e621 /* Identifier clash - length set by -idlen */
+ +elib(621)
+ -append(621,[MISRA 2012 Rule 5.1, required])
+
+/**** Rule 5.2 (Req) ************/
+
+ -idlen(31) /* flag names identical in the first 31 characters */
+ +e621 /* Identifier clash - length set by -idlen */
+ +elib(621)
+ -append(621,[MISRA 2012 Rule 5.2, required])
+
+/**** Rule 5.3 (Req) ************/
+
+ +e578 /* enable reports of name hiding */
+ +elib(578)
+ -append(578,[MISRA 2012 Rule 5.3, required])
+
+/**** Rule 5.4 (Req) ************/
+
+ -idlen(31) /* flag names identical in the first 31 characters */
+ +e621 /* Identifier clash - length set by -idlen */
+ +elib(621)
+ -append(621,[MISRA 2012 Rule 5.4, required])
+
+/**** Rule 5.5 (Req) ************/
+
+ +e123 /* macro defined with arguments */
+ +elib(123)
+ -append(123,[MISRA 2012 Rule 5.5, required])
+ -idlen(31) /* flag names identical in the first 31 characters */
+ +e621 /* Identifier clash - length set by -idlen */
+ +elib(621)
+ -append(621,[MISRA 2012 Rule 5.5, required])
+ +e9061 /* non-distinct identifier */
+ +elib(9061)
+ -append(9061,[MISRA 2012 Rule 5.5, required])
+
+/**** Rule 5.6 (Req) ************/
+
+ +e578 /* enable reports of name hiding */
+ +elib(578)
+ -append(578,[MISRA 2012 Rule 5.6, required])
+ +e623 /* redefining the storage class of symbol */
+ +elib(623)
+ -append(623,[MISRA 2012 Rule 5.6, required])
+ +estring(9062,typedef) /* non-unique typedef */
+ +elib(9062)
+ -append(9062(typedef),[MISRA 2012 Rule 5.6, required])
+
+/**** Rule 5.7 (Req) ************/
+
+ +e407 /* Inconsistent use of tag */
+ +elib(407)
+ -append(407,[MISRA 2012 Rule 5.7, required])
+ +e578 /* Declaration of Symbol hides Symbol */
+ +elib(578)
+ -append(578,[MISRA 2012 Rule 5.7, required])
+ +e14 /* Symbol previously defined */
+ +elib(14)
+ -append(14,[MISRA 2012 Rule 5.7, required])
+ +e15 /* Symbol redeclared */
+ +elib(15)
+ -append(15,[MISRA 2012 Rule 5.7, required])
+ +e631 /* Tag defined differently */
+ +elib(631)
+ -append(631,[MISRA 2012 Rule 5.7, required])
+ +e9062 /* non-unique tag */
+ +elib(9062)
+ -append(9062(tag),[MISRA 2012 Rule 5.7, required])
+
+/**** Rule 5.8 (Req) ************/
+
+ +e401 /* Symbol not previously declared static */
+ +elib(401)
+ -append(401,[MISRA 2012 Rule 5.8, required])
+ +e578 /* Declaration of Symbol hides Symbol */
+ +elib(578)
+ -append(578,[MISRA 2012 Rule 5.8, required])
+ +e580 /* enable reports of name hiding */
+ +elib(580)
+ -append(580,[MISRA 2012 Rule 5.8, required])
+
+/**** Rule 5.9 (Adv) ************/
+
+ +e578 /* enable reports of name hiding */
+ +elib(578)
+ -append(578,[MISRA 2012 Rule 5.9, advisory])
+ +e580 /* enable reports of name hiding */
+ +elib(580)
+ -append(580,[MISRA 2012 Rule 5.9, advisory])
+
+/**** Rule 6.1 (Req) ************/
+
+ +e46 /* field type should be int */
+ +elib(46)
+ -append(46,[MISRA 2012 Rule 6.1, required])
+ +e806 /* small bit field is signed rather than unsigned */
+ +elib(806)
+ -append(806,[MISRA 2012 Rule 6.1, required])
+
+/**** Rule 6.2 (Req) ************/
+
+ +e9088 /* named signed single-bit bit-field */
+ +elib(9088)
+ -append(9088,[MISRA 2012 Rule 6.2, required])
+
+/**** Rule 7.1 (Req) ************/
+
+ +e9001 /* Octal constant used */
+ +elib(9001)
+ -append(9001,[MISRA 2012 Rule 7.1, required])
+
+/**** Rule 7.2 (Req) ************/
+
+ +e9048 /* unsigned literal without 'U' suffix */
+ +elib(9048)
+ -append(9048,[MISRA 2012 Rule 7.2, required])
+
+/**** Rule 7.3 (Req) ************/
+
+ +e620 /* suspicious constant */
+ +elib(620)
+ -append(620,[MISRA 2012 Rule 7.3, required])
+ +e9057 /* "l" after "u" in literal suffix */
+ +elib(9057)
+ -append(9057,[MISRA 2012 Rule 7.3, required])
+
+/**** Rule 7.4 (Req) ************/
+
+ +fsc
+ +e489 /* attempting to modify a string literal */
+ +elib(489)
+ -append(489,[MISRA 2012 Rule 7.4, required])
+ +e1776 /* string literal not const safe */
+ +elib(1776)
+ -append(1776,[MISRA 2012 Rule 7.4, required])
+ +e1778 /* assignment of string literal not const safe */
+ +elib(1778)
+ -append(1778,[MISRA 2012 Rule 7.4, required])
+
+/**** Rule 8.1 (Req) ************/
+
+ +e601 /* no explicit type */
+ +elib(601)
+ -append(601,[MISRA 2012 Rule 8.1, required])
+ +e745 /* function has no explicit type */
+ +elib(745)
+ -append(745,[MISRA 2012 Rule 8.1, required])
+ +e808 /* no explicit type */
+ +elib(808)
+ -append(808,[MISRA 2012 Rule 8.1, required])
+ +e832 /* parameter has no explicit type */
+ +elib(832)
+ -append(832,[MISRA 2012 Rule 8.1, required])
+ +e939 /* return type defaults to int */
+ +elib(939)
+ -append(939,[MISRA 2012 Rule 8.1, required])
+
+/**** Rule 8.2 (Req) ************/
+
+ +e937 /* old-style function declaration */
+ +elib(937)
+ -append(937,[MISRA 2012 Rule 8.2, required])
+ +e745 /* function has no explicit type */
+ +elib(745)
+ -append(745,[MISRA 2012 Rule 8.2, required])
+ +e939 /* return type defaults to int */
+ +elib(939)
+ -append(939,[MISRA 2012 Rule 8.2, required])
+ -fvr /* varying return mode not allowed */
+ -strong() /* enable strong typing for
+ declarations */
+ +e18 /* symbol redeclared */
+ +elib(18)
+ -append(18,[MISRA 2012 Rule 8.2, required])
+
+ +e936 /* old-style function definition */
+ +elib(936)
+ -append(936,[MISRA 2012 Rule 8.2, required])
+
+ +e955 /* param name missing from prototype */
+ +elib(955)
+ -append(955,[MISRA 2012 Rule 8.2, required])
+
+/**** Rule 8.3 (Req) ************/
+
+ -fvr /* varying return mode not allowed */
+ -strong() /* enable strong typing for declarations */
+ +e18 /* symbol redeclared */
+ +elib(18)
+ -append(18,[MISRA 2012 Rule 8.3, required])
+ +e516 /* argument type conflict */
+ +elib(516)
+ -append(516,[MISRA 2012 Rule 8.3, required])
+ +e532 /* return mode of symbol inconsistent */
+ +elib(532)
+ -append(532,[MISRA 2012 Rule 8.3, required])
+ +e9072 /* parameter list differs */
+ +elib(9072)
+ -append(9072,[MISRA 2012 Rule 8.3, required])
+
+/**** Rule 8.4 (Req) ************/
+
+ +e15 /* symbol redeclared */
+ +elib(15)
+ -append(15,[MISRA 2012 Rule 8.4, required])
+ +e64 /* flag type mismatch */
+ +elib(64)
+ -append(64,[MISRA 2012 Rule 8.4, required])
+ +e516 /* argument type mismatch */
+ +elib(516)
+ -append(516,[MISRA 2012 Rule 8.4, required])
+ +e9075 /* extern defined without prior declaration */
+ +elib(9075)
+ -append(9075,[MISRA 2012 Rule 8.4, required])
+
+/**** Rule 8.5 (Req) ************/
+
+ +e9004 /* object/function previously declared */
+ +elib(9004)
+ -append(9004,[MISRA 2012 Rule 8.5, required])
+
+/**** Rule 8.6 (Req) ************/
+
+ --fmd /* diallow multiple definitions */
+ +e14 /* Symbol previously defined */
+ +elib(14)
+ -append(14,[MISRA 2012 Rule 8.6, required])
+
+/**** Rule 8.7 (Adv) ************/
+
+ +e765 /* could be made static */
+ +elib(765)
+ -append(765,[MISRA 2012 Rule 8.7, advisory])
+
+/**** Rule 8.8 (Req) ************/
+
+ +e839 /* storage class assumed static */
+ +elib(839)
+ -append(839,[MISRA 2012 Rule 8.8, required])
+
+/**** Rule 8.9 (Adv) ************/
+
+ +e9003 /* could define variable at block scope */
+ +elib(9003)
+ -append(9003,[MISRA 2012 Rule 8.9, advisory])
+
+/**** Rule 8.10 (Req) ************/
+
+ +e695 /* inline function without storage-class specifier */
+ +elib(695)
+ -append(695,[MISRA 2012 Rule 8.10, required])
+ +estring(9056,extern) /* inline function defined with extern */
+ -append(9056,[MISRA 2012 Rule 8.10, required])
+
+/**** Rule 8.11 (Adv) ************/
+
+ +e9067 /* array has no dimension or initializer */
+ +elib(9067)
+ -append(9067,[MISRA 2012 Rule 8.11, advisory])
+
+/**** Rule 8.12 (Req) ************/
+
+ +e488 /* duplicate enumerator values */
+ +elib(488)
+ -append(488,[MISRA 2012 Rule 8.12, required])
+
+/**** Rule 8.13 (Adv) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e818 /* pointer could be declared pointing to const */
+ +elib(818)
+ -append(818,[MISRA 2012 Rule 8.13, advisory])
+ +e844 /* pointer could be declared pointing to const */
+ +elib(844)
+ -append(844,[MISRA 2012 Rule 8.13, advisory])
+ +e954 /* pointer could be declared pointing to const */
+ +elib(954)
+ -append(954,[MISRA 2012 Rule 8.13, advisory])
+
+/**** Rule 8.14 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(keyword,restrict,[MISRA 2012 Rule 8.14, required])
+
+/**** Rule 9.1 (Mand) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e644 /* Symbol may not have been initialized */
+ +elib(644)
+ -append(644,[MISRA 2012 Rule 9.1, mandatory])
+ +e771 /* Symbol conceivably not initialized */
+ +elib(771)
+ -append(771,[MISRA 2012 Rule 9.1, mandatory])
+ +e530 /* Symbol not initialized */
+ +elib(530)
+ -append(530,[MISRA 2012 Rule 9.1, mandatory])
+ -specific(+e644 +e771 +e530,)
+
+/**** Rule 9.2 (Req) ************/
+
+ +e9069 /* omitted braces within an initializer */
+ +elib(9069)
+ -append(9069,[MISRA 2012 Rule 9.2, required])
+
+/**** Rule 9.3 (Req) ************/
+
+ +e9068 /* too few initializers */
+ +elib(9068)
+ -append(9068,[MISRA 2012 Rule 9.3, required])
+
+/**** Rule 9.4 (Req) ************/
+
+ +e485 /* duplicate initialization */
+ +elib(485)
+ -append(485,[MISRA 2012 Rule 9.4, required])
+
+/**** Rule 9.5 (Req) ************/
+
+ +e9054 /* designated initializer and dimensionless array */
+ +elib(9054)
+ -append(9054,[MISRA 2012 Rule 9.5, required])
+
+/**** Rule 10.1 (Req) ************/
+
+ +e48 /* bad type */
+ +elib(48)
+ -append(48,[MISRA 2012 Rule 10.1, required])
+ +e9027 /* unpermitted operand */
+ +elib(9027)
+ -append(9027,[MISRA 2012 Rule 10.1, required])
+
+/**** Rule 10.2 (Req) ************/
+
+ +e9028 /* unpermitted arithmetic */
+ +elib(9028)
+ -append(9028,[MISRA 2012 Rule 10.2, required])
+
+/**** Rule 10.3 (Req) ************/
+
+ +e9034 /* expression assigned to narrower or different essential type */
+ +elib(9034)
+ // Note: the following -d options for true and false don't apply
+ // to C90 and should be commented out if not using C99
+ +"dtrue=/*lint -save -e921 */(_Bool) 1/*lint -restore */" // exception
+ +"dfalse=/*lint -save -e921 */(_Bool) 0/*lint -restore */" // exception
+ -append(9034,[MISRA 2012 Rule 10.3, required])
+
+/**** Rule 10.4 (Req) ************/
+
+ +e9029 /* mismatched essential type */
+ +elib(9029)
+ -append(9029,[MISRA 2012 Rule 10.4, required])
+
+/**** Rule 10.5 (Adv) ************/
+
+ +e9030 /* impermissible cast */
+ +elib(9030)
+ -append(9030,[MISRA 2012 Rule 10.5, advisory])
+
+/**** Rule 10.6 (Req) ************/
+
+ +e9031 /* composite expression assigned to wider essential type */
+ +elib(9031)
+ -append(9031,[MISRA 2012 Rule 10.6, required])
+
+/**** Rule 10.7 (Req) ************/
+
+ +e9032 /* composite expression with smaller essential type than other operand*/
+ +elib(9032)
+ -append(9032,[MISRA 2012 Rule 10.7, required])
+
+/**** Rule 10.8 (Req) ************/
+
+ +e9033 /* impermissible cast of composite expression */
+ +elib(9033)
+ -append(9033,[MISRA 2012 Rule 10.8, required])
+
+/**** Rule 11.1 (Req) ************/
+
+ +e9074 /* conversion between a pointer to function and another type */
+ +elib(9074)
+ --emacro((9074),NULL) /* explicit exception */
+ -append(9074,[MISRA 2012 Rule 11.1, required])
+
+/**** Rule 11.2 (Req) ************/
+
+ +e9076 /* conversion between a pointer to incomplete type and another type */
+ +elib(9076)
+ --emacro((9076),NULL) /* explicit exception */
+ -append(9076,[MISRA 2012 Rule 11.2, required])
+
+/**** Rule 11.3 (Req) ************/
+
+ +e9087 /* cast from pointer to pointer */
+ +elib(9087)
+ -append(9087,[MISRA 2012 Rule 11.3, required])
+
+/**** Rule 11.4 (Adv) ************/
+
+ +e9078 /* cast pointer/integer */
+ +elib(9078)
+ -append(9078,[MISRA 2012 Rule 11.4, advisory])
+
+/**** Rule 11.5 (Adv) ************/
+
+ +e9079 /* cast from pointer to pointer */
+ +elib(9079)
+ -append(9079,[MISRA 2012 Rule 11.5, advisory])
+
+/**** Rule 11.6 (Req) ************/
+
+ +e923 /* cast pointer/non-pointer */
+ +elib(923)
+ -append(923,[MISRA 2012 Rule 11.6, required])
+
+/**** Rule 11.7 (Req) ************/
+
+ +e68 /* cast pointer/float */
+ +elib(68)
+ -append(68,[MISRA 2012 Rule 11.7, required])
+ +e70 /* cast pointer/float */
+ +elib(70)
+ -append(70,[MISRA 2012 Rule 11.7, required])
+
+/**** Rule 11.8 (Req) ************/
+
+ +e9005 /* attempt to cast away const/volatile from pointer or reference */
+ +elib(9005)
+ -append(9005,[MISRA 2012 Rule 11.8, required])
+
+/**** Rule 11.9 (Req) ************/
+
+ +e910 /* conversion from 0 to pointer */
+ +elib(910)
+ --emacro((910),NULL) /* explicit exception */
+ -append(910,[MISRA 2012 Rule 11.9, required])
+ +e9080 /* integer null pointer constant */
+ +elib(9080)
+ -append(9080,[MISRA 2012 Rule 11.9, required])
+
+/**** Rule 12.1 (Adv) ************/
+
+ +e9050 /* dependence placed on precedence */
+ +elib(9050)
+ -append(9050,[MISRA 2012 Rule 12.1, advisory])
+
+/**** Rule 12.2 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e598 /* excessive left shift */
+ +elib(598)
+ -append(598,[MISRA 2012 Rule 12.2, required])
+ +e9053 /* shift value exceeds size of LHS */
+ +elib(9053)
+ -append(9053,[MISRA 2012 Rule 12.2, required])
+
+/**** Rule 12.3 (Adv) ************/
+
+ +e9008 /* comma operator used */
+ +elib(9008)
+ -append(9008,[MISRA 2012 Rule 12.3, advisory])
+
+/**** Rule 12.4 (Adv) ************/
+
+ +elib(648) /* Overflow in computing constant */
+ +estring(648,unsigned addition)
+ +estring(648,unsigned multiplication)
+ +estring(648,unsigned sub.)
+ +estring(648,unsigned shift left)
+ +estring(648,unsigned shift right)
+ -append(648,[MISRA 2012 Rule 12.4, advisory])
+
+/**** Rule 13.1 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e446 /* side effect in initializer */
+ +elib(446)
+ -append(446,[MISRA 2012 Rule 13.1, required])
+
+/**** Rule 13.2 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e564 /* variable depends on order of evaluation */
+ +elib(564)
+ -append(564,[MISRA 2012 Rule 13.2, required])
+ +e864 /* variable possibly depends on order of evaluation */
+ +elib(864)
+ -append(864,[MISRA 2012 Rule 13.2, required])
+ +e931 /* both sides have side effects */
+ +elib(931)
+ -append(931,[MISRA 2012 Rule 13.2, required])
+
+/**** Rule 13.3 (Adv) ************/
+
+ +e9049 /* increment/decrement combined with other operations */
+ +elib(9049)
+ -append(9049,[MISRA 2012 Rule 13.3, advisory])
+
+/**** Rule 13.4 (Adv) ************/
+
+ +e720 /* Boolean test of assignment */
+ +elib(720)
+ -append(720,[MISRA 2012 Rule 13.4, advisory])
+ +e820 /* Boolean test of parenthesized assignment */
+ +elib(820)
+ -append(820,[MISRA 2012 Rule 13.4, advisory])
+ +e9084 /* assignment used inside larger
+ expression */
+ +elib(9084)
+ -append(9084,[MISRA 2012 Rule 13.4, advisory])
+
+/**** Rule 13.5 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e9007 /* side effects on right hand side of logical operator */
+ +elib(9007)
+ -append(9007,[MISRA 2012 Rule 13.5, required])
+
+/**** Rule 13.6 (Mand) ************/
+
+ +e9006 /* sizeof used with expression with side effect */
+ +elib(9006)
+ -append(9006,[MISRA 2012 Rule 13.6, mandatory])
+ +e9089 /* potential side-effect in argument to sizeof */
+ +elib(9089)
+ -append(9089,[MISRA 2012 Rule 13.6, mandatory])
+
+/**** Rule 14.1 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e9009 /* floating point variable used as loop counter */
+ +elib(9009)
+ -append(9009,[MISRA 2012 Rule 14.1, required])
+
+/**** Rule 14.2 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e850 /* index variable modified in body of for loop */
+ +elib(850)
+ -append(850,[MISRA 2012 Rule 14.2, required])
+
+/**** Rule 14.3 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e685 /* relational always evaluates to true/false */
+ +elib(685)
+ -append(685,[MISRA 2012 Rule 14.3, required])
+ +e774 /* boolean always evaluates to true/false */
+ +elib(774)
+ -append(774,[MISRA 2012 Rule 14.3, required])
+ +e650 /* constant out of range for operator */
+ +elib(650)
+ -append(650,[MISRA 2012 Rule 14.3, required])
+
+/**** Rule 14.4 (Req) ************/
+
+ +e9036 /* condition should have essentially Boolean type */
+ +elib(9036)
+ -append(9036,[MISRA 2012 Rule 14.4, required])
+
+/**** Rule 15.1 (Adv) ************/
+
+ +e801 /* use of 'goto' is deprecated */
+ +elib(801)
+ -append(801,[MISRA 2012 Rule 15.1, advisory])
+
+/**** Rule 15.2 (Req) ************/
+
+ +e9064 /* goto references earlier label */
+ +elib(9064)
+ -append(9064,[MISRA 2012 Rule 15.2, required])
+
+/**** Rule 15.3 (Req) ************/
+
+ +e9041 /* goto not nested in the same block as label */
+ +elib(9041)
+ -append(9041,[MISRA 2012 Rule 15.3, required])
+
+/**** Rule 15.4 (Adv) ************/
+
+ +e9011 /* more than one 'break' terminates loop */
+ +elib(9011)
+ -append(9011,[MISRA 2012 Rule 15.4, advisory])
+
+/**** Rule 15.5 (Adv) ************/
+
+ +e904 /* return before function end */
+ +elib(904)
+ -append(904,[MISRA 2012 Rule 15.5, advisory])
+
+/**** Rule 15.6 (Req) ************/
+
+ +e9012 /* sub-statement should be a compound statement */
+ +elib(9012)
+ -append(9012,[MISRA 2012 Rule 15.6, required])
+
+/**** Rule 15.7 (Req) ************/
+
+ +e9013 /* no 'else' at end of 'if ... else if' chain */
+ +elib(9013)
+ -append(9013,[MISRA 2012 Rule 15.7, required])
+ +e9063 /* no comment or action in else-branch */
+ +elib(9063)
+ -append(9063,[MISRA 2012 Rule 15.7, required])
+
+/**** Rule 16.1 (Req) ************/
+
+ +e616 /* control flows into case/default */
+ +elib(616)
+ -append(616,[MISRA 2012 Rule 16.1, required])
+ +e744 /* switch statement has no default */
+ +elib(744)
+ -append(744,[MISRA 2012 Rule 16.1, required])
+ +e764 /* switch does not have a case */
+ +elib(764)
+ -append(764,[MISRA 2012 Rule 16.1, required])
+ +e825 /* control flows into case/default without -fallthrough comment */
+ +elib(825)
+ -append(825,[MISRA 2012 Rule 16.1, required])
+ +e9014 /* default missing from switch */
+ +elib(9014)
+ -append(9014,[MISRA 2012 Rule 16.1, required])
+ +e9042 /* departure from MISRA switch syntax */
+ +elib(9042)
+ -append(9042,[MISRA 2012 Rule 16.1, required])
+ +e9077 /* missing unconditional break */
+ +elib(9077)
+ -append(9077,[MISRA 2012 Rule 16.1, required])
+ +e9081 /* too few independent cases for switch */
+ +elib(9081)
+ -append(9081,[MISRA 2012 Rule 16.1, required])
+ +e9082 /* switch statement should either begin or end with default label */
+ +elib(9082)
+ -append(9082,[MISRA 2012 Rule 16.1, required])
+ +e9085 /* statement or comment should appear in default case */
+ +elib(9085)
+ -append(9085,[MISRA 2012 Rule 16.1, required])
+
+/**** Rule 16.2 (Req) ************/
+
+ +e44 /* Need a switch */
+ +elib(44)
+ -append(44,[MISRA 2012 Rule 16.2, required])
+ +e9055 /* enclosing statement is not a switch */
+ +elib(9055)
+ -append(9055,[MISRA 2012 Rule 16.2, required])
+
+/**** Rule 16.3 (Req) ************/
+
+ +e616 /* control flows into case/default */
+ +elib(616)
+ -append(616,[MISRA 2012 Rule 16.3, required])
+ +e825 /* control flows into case/default without -fallthrough comment */
+ +elib(825)
+ -append(825,[MISRA 2012 Rule 16.3, required])
+ +e9077 /* missing unconditional break */
+ +elib(9077)
+ -append(9077,[MISRA 2012 Rule 16.3, required])
+ +e9090 /* missing unconditional break */
+ +elib(9090)
+ -append(9090,[MISRA 2012 Rule 16.3, required])
+
+/**** Rule 16.4 (Req) ************/
+
+ +e744 /* switch statement has no default */
+ +elib(744)
+ -append(744,[MISRA 2012 Rule 16.4, required])
+ +e9014 /* switch statement has no default */
+ +elib(9014)
+ -append(9014,[MISRA 2012 Rule 16.4, required])
+ +e9085 /* default case has no statement nor comment */
+ +elib(9085)
+ -append(9085,[MISRA 2012 Rule 16.4, required])
+
+/**** Rule 16.5 (Req) ************/
+
+ +e9082 /* default should be first or last */
+ +elib(9082)
+ -append(9082,[MISRA 2012 Rule 16.5, required])
+
+/**** Rule 16.6 (Req) ************/
+
+ +e764 /* switch does not have a case */
+ +elib(764)
+ -append(764,[MISRA 2012 Rule 16.6, required])
+ +e9081 /* too few cases */
+ +elib(9081)
+ -append(9081,[MISRA 2012 Rule 16.6, required])
+
+/**** Rule 16.7 (Req) ************/
+
+ +e483 /* boolean value in switch expression */
+ +elib(483)
+ -append(483,[MISRA 2012 Rule 16.7, required])
+
+/**** Rule 17.1 (Req) ************/
+
+ +e829 /* warn on header usage */
+ +elib(829)
+ +headerwarn(stdarg.h)
+ -append(829(stdarg.h),[MISRA 2012 Rule 17.1, required])
+ -deprecate(macro,va_arg,[MISRA 2012 Rule 17.1, required])
+ -deprecate(macro,va_start,[MISRA 2012 Rule 17.1, required])
+ -deprecate(macro,va_end,[MISRA 2012 Rule 17.1, required])
+ -deprecate(macro,va_copy,[MISRA 2012 Rule 17.1, required])
+
+/**** Rule 17.2 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e9070
+ -append(9070,[MISRA 2012 Rule 17.2, required])
+
+/**** Rule 17.3 (Mand) ************/
+
+ +e718 /* symbol undeclared, assumed to return int */
+ +elib(718)
+ -append(718,[MISRA 2012 Rule 17.3, mandatory])
+
+/**** Rule 17.4 (Mand) ************/
+
+ +e533 /* function should return a value */
+ +elib(533)
+ -append(533,[MISRA 2012 Rule 17.4, mandatory])
+
+/**** Rule 17.5 (Adv) ************/
+
+ /* MISRA has declared this rule to be "undecidable". */
+
+/**** Rule 17.6 (Mand) ************/
+
+ +e9043 /* static between brackets of array declaration */
+ +elib(9043)
+ -append(9043,[MISRA 2012 Rule 17.6, mandatory])
+
+/**** Rule 17.7 (Req) ************/
+
+ +e534 /* ignoring return value of function */
+ +elib(534)
+ -append(534,[MISRA 2012 Rule 17.7, required])
+
+/**** Rule 17.8 (Adv) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e9044 /* function parameter modified */
+ +elib(9044)
+ -append(9044,[MISRA 2012 Rule 17.8, advisory])
+
+/**** Rule 18.1 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e415 /* out-of-bounds pointer */
+ +elib(415)
+ -append(415,[MISRA 2012 Rule 18.1, required])
+ +e416 /* out-of-bounds pointer */
+ +elib(416)
+ -append(416,[MISRA 2012 Rule 18.1, required])
+ +e428 /* out-of-bounds pointer */
+ +elib(428)
+ -append(428,[MISRA 2012 Rule 18.1, required])
+ +e661 /* out-of-bounds pointer */
+ +elib(661)
+ -append(661,[MISRA 2012 Rule 18.1, required])
+ +e662 /* out-of-bounds pointer */
+ +elib(662)
+ -append(662,[MISRA 2012 Rule 18.1, required])
+ +e676 /* out-of-bounds pointer */
+ +elib(676)
+ -append(676,[MISRA 2012 Rule 18.1, required])
+ +e796 /* out-of-bounds pointer */
+ +elib(796)
+ -append(796,[MISRA 2012 Rule 18.1, required])
+ +e797 /* out-of-bounds pointer */
+ +elib(797)
+ -append(797,[MISRA 2012 Rule 18.1, required])
+ +e817 /* out-of-bounds pointer */
+ +elib(817)
+ -append(817,[MISRA 2012 Rule 18.1, required])
+
+/**** Rule 18.2 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e946 /* relational or subtract operator applied to pointers */
+ +elib(946)
+ -append(946,[MISRA 2012 Rule 18.2, required])
+ +e947 /* relational or subtract operator applied to pointers */
+ +elib(947)
+ -append(947,[MISRA 2012 Rule 18.2, required])
+
+/**** Rule 18.3 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e946 /* relational or subtract operator applied to pointers */
+ +elib(946)
+ -append(946,[MISRA 2012 Rule 18.3, required])
+ +e947 /* relational or subtract operator applied to pointers */
+ +elib(947)
+ -append(947,[MISRA 2012 Rule 18.3, required])
+
+/**** Rule 18.4 (Adv) ************/
+
+ +e9016 /* pointer arithmetic other than array indexing used */
+ +elib(9016)
+ -append(9016,[MISRA 2012 Rule 18.4, advisory])
+
+/**** Rule 18.5 (Adv) ************/
+
+ +e9025 /* more than two pointer indirection levels used */
+ +elib(9025)
+ -append(9025,[MISRA 2012 Rule 18.5, advisory])
+
+/**** Rule 18.6 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e733 /* assigning address of auto to outer scope symbol */
+ +elib(733)
+ -append(733,[MISRA 2012 Rule 18.6, required])
+ +e789 /* assigning address of auto to static */
+ +elib(789)
+ -append(789,[MISRA 2012 Rule 18.6, required])
+ +e604 /* returning address of auto variable */
+ +elib(604)
+ -append(604,[MISRA 2012 Rule 18.6, required])
+
+/**** Rule 18.7 (Req) ************/
+
+ +e9038 /* flexible array member declared */
+ +elib(9038)
+ -append(9038,[MISRA 2012 Rule 18.7, required])
+
+/**** Rule 18.8 (Req) ************/
+
+ +e9035 /* variable length array declared */
+ +elib(9035)
+ -append(9035,[MISRA 2012 Rule 18.8, required])
+
+/**** Rule 19.1 (Mand) ************/
+
+ /* MISRA has declared this rule to be "undecidable". */
+
+/**** Rule 19.2 (Adv) ************/
+
+ +e9018 /* union type/object declared */
+ +elib(9018)
+ -append(9018,[MISRA 2012 Rule 19.2, advisory])
+
+/**** Rule 20.1 (Adv) ************/
+
+ +e9019 /* declaration before #include */
+ +elib(9019)
+ -append(9019,[MISRA 2012 Rule 20.1, advisory])
+
+/**** Rule 20.2 (Req) ************/
+
+ +e9020 /* header file name with non-standard character */
+ +elib(9020)
+ -append(9020,[MISRA 2012 Rule 20.2, required])
+ /* Note: If your system requires the '\' be used as a directory
+ separator, uncomment the following option.
+ */
+ // -estring(9020,\)
+
+/**** Rule 20.3 (Req) ************/
+
+ +e12 /* Need < or " after #include */
+ +elib(12)
+ -append(12,[MISRA 2012 Rule 20.3, required])
+ +e9086 /* multiple arguments after #include */
+ +elib(9086)
+ -append(9086,[MISRA 2012 Rule 20.3, required])
+
+/**** Rule 20.4 (Req) ************/
+
+ +e9051 /* macro with same name as a keyword */
+ +elib(9051)
+ -append(9051,[MISRA 2012 Rule 20.4, required])
+
+/**** Rule 20.5 (Adv) ************/
+
+ +e9021 /* use of '#undef' is discouraged */
+ +elib(9021)
+ -append(9021,[MISRA 2012 Rule 20.5, advisory])
+
+/**** Rule 20.6 (Req) ************/
+
+ +e436 /* preprocessor directive in invocation of macro */
+ +elib(436)
+ -append(436,[MISRA 2012 Rule 20.6, required])
+
+/**** Rule 20.7 (Req) ************/
+
+ +e665 /* expression passed to unparenthesized macro */
+ +elib(665)
+ -append(665,[MISRA 2012 Rule 20.7, required])
+
+/**** Rule 20.8 (Req) ************/
+
+ +e9037 /* conditional of #if/#elif does not evaluate to 0 or 1 */
+ +elib(9037)
+ -append(9037,[MISRA 2012 Rule 20.8, required])
+
+/**** Rule 20.9 (Req) ************/
+
+ +e553 /* Undefined preprocessor variable, assumed 0 */
+ +elib(553)
+ -append(553,[MISRA 2012 Rule 20.9, required])
+
+/**** Rule 20.10 (Adv) ************/
+
+ +e9024 /* '#/##' operators used */
+ +elib(9024)
+ -append(9024,[MISRA 2012 Rule 20.10, advisory])
+
+/**** Rule 20.11 (Req) ************/
+
+ +e484 /* stringize operator followed by macro parameter followed by pasting operator */
+ +elib(484)
+ -append(484,[MISRA 2012 Rule 20.11, required])
+
+/**** Rule 20.12 (Req) ************/
+
+ +e9015 /* macro argument is used both with and without '#/##' and is subject to further replacement */
+ +elib(9015)
+ -append(9015,[MISRA 2012 Rule 20.12, required])
+
+/**** Rule 20.13 (Req) ************/
+
+ +e544 /* endif or else not followed by EOL */
+ +elib(544)
+ -append(544,[MISRA 2012 Rule 20.13, required])
+ +e16 /* # directive not followed by recognizable word */
+ +elib(16)
+ -append(16,[MISRA 2012 Rule 20.13, required])
+ /* other parts of this rule such as a syntax check of the disabled
+ portions of the code do not seem to be statically checkable
+ */
+
+/**** Rule 20.14 (Req) ************/
+
+ +e405 /* #if/#ifdef/#ifndef not closed off */
+ +elib(405)
+ -append(405,[MISRA 2012 Rule 20.14, required])
+
+/**** Rule 21.1 (Req) ************/
+
+ +e136 /* Illegal macro name */
+ +elib(136)
+ -append(136,[MISRA 2012 Rule 21.1, required])
+ /* Undefining standard library macros is covered by rule 20.5. */
+ /* Defining/redefining reserved/standard identifiers is covered
+ by rules 20.4 and 21.2.
+ */
+ +e9071 /* defined macro reserved to the compiler */
+ +elib(9071)
+ -append(9071,[MISRA 2012 Rule 21.1, required])
+ // explicit exemptions
+ -estring(9071,* because *)
+ -estring(9071,cerf)
+ -estring(9071,cerfc)
+ -estring(9071,cexp2)
+ -estring(9071,cexpm1)
+ -estring(9071,clog10)
+ -estring(9071,clog1p)
+ -estring(9071,clog2)
+ -estring(9071,clgamma)
+ -estring(9071,ctgamma)
+ -estring(9071,cerff)
+ -estring(9071,cerfcf)
+ -estring(9071,cexp2f)
+ -estring(9071,cexpm1f)
+ -estring(9071,clog10f)
+ -estring(9071,clog1pf)
+ -estring(9071,clog2f)
+ -estring(9071,clgammaf)
+ -estring(9071,ctgammaf)
+ -estring(9071,cerfl)
+ -estring(9071,cerfcl)
+ -estring(9071,cexp2l)
+ -estring(9071,cexpm1l)
+ -estring(9071,clog10l)
+ -estring(9071,clog1pl)
+ -estring(9071,clog2l)
+ -estring(9071,clgammal)
+ -estring(9071,ctgammal)
+ -estring(9071,E0*)
+ -estring(9071,E1*)
+ -estring(9071,E2*)
+ -estring(9071,E3*)
+ -estring(9071,E4*)
+ -estring(9071,E5*)
+ -estring(9071,E6*)
+ -estring(9071,E7*)
+ -estring(9071,E8*)
+ -estring(9071,E9*)
+ -estring(9071,NDEBUG)
+ -estring(9071,PRIa*)
+ -estring(9071,PRIb*)
+ -estring(9071,PRIc*)
+ -estring(9071,PRId*)
+ -estring(9071,PRIe*)
+ -estring(9071,PRIf*)
+ -estring(9071,PRIg*)
+ -estring(9071,PRIh*)
+ -estring(9071,PRIi*)
+ -estring(9071,PRIj*)
+ -estring(9071,PRIk*)
+ -estring(9071,PRIl*)
+ -estring(9071,PRIm*)
+ -estring(9071,PRIn*)
+ -estring(9071,PRIo*)
+ -estring(9071,PRIp*)
+ -estring(9071,PRIq*)
+ -estring(9071,PRIr*)
+ -estring(9071,PRIs*)
+ -estring(9071,PRIt*)
+ -estring(9071,PRIu*)
+ -estring(9071,PRIv*)
+ -estring(9071,PRIw*)
+ -estring(9071,PRIx*)
+ -estring(9071,PRIy*)
+ -estring(9071,PRIz*)
+ -estring(9071,PRIX*)
+ -estring(9071,SCNa*)
+ -estring(9071,SCNb*)
+ -estring(9071,SCNc*)
+ -estring(9071,SCNd*)
+ -estring(9071,SCNe*)
+ -estring(9071,SCNf*)
+ -estring(9071,SCNg*)
+ -estring(9071,SCNh*)
+ -estring(9071,SCNi*)
+ -estring(9071,SCNj*)
+ -estring(9071,SCNk*)
+ -estring(9071,SCNl*)
+ -estring(9071,SCNm*)
+ -estring(9071,SCNn*)
+ -estring(9071,SCNo*)
+ -estring(9071,SCNp*)
+ -estring(9071,SCNq*)
+ -estring(9071,SCNr*)
+ -estring(9071,SCNs*)
+ -estring(9071,SCNt*)
+ -estring(9071,SCNu*)
+ -estring(9071,SCNv*)
+ -estring(9071,SCNw*)
+ -estring(9071,SCNx*)
+ -estring(9071,SCNy*)
+ -estring(9071,SCNz*)
+ -estring(9071,SCNX*)
+ +e9083 /* undefined macro reserved to the compiler */
+ +elib(9083)
+ -append(9083,[MISRA 2012 Rule 21.1, required])
+ // explicit exemptions
+ -estring(9083,* because *)
+ -estring(9083,cerf)
+ -estring(9083,cerfc)
+ -estring(9083,cexp2)
+ -estring(9083,cexpm1)
+ -estring(9083,clog10)
+ -estring(9083,clog1p)
+ -estring(9083,clog2)
+ -estring(9083,clgamma)
+ -estring(9083,ctgamma)
+ -estring(9083,cerff)
+ -estring(9083,cerfcf)
+ -estring(9083,cexp2f)
+ -estring(9083,cexpm1f)
+ -estring(9083,clog10f)
+ -estring(9083,clog1pf)
+ -estring(9083,clog2f)
+ -estring(9083,clgammaf)
+ -estring(9083,ctgammaf)
+ -estring(9083,cerfl)
+ -estring(9083,cerfcl)
+ -estring(9083,cexp2l)
+ -estring(9083,cexpm1l)
+ -estring(9083,clog10l)
+ -estring(9083,clog1pl)
+ -estring(9083,clog2l)
+ -estring(9083,clgammal)
+ -estring(9083,ctgammal)
+ -estring(9083,E0*)
+ -estring(9083,E1*)
+ -estring(9083,E2*)
+ -estring(9083,E3*)
+ -estring(9083,E4*)
+ -estring(9083,E5*)
+ -estring(9083,E6*)
+ -estring(9083,E7*)
+ -estring(9083,E8*)
+ -estring(9083,E9*)
+ -estring(9083,NDEBUG)
+ -estring(9083,PRIa*)
+ -estring(9083,PRIb*)
+ -estring(9083,PRIc*)
+ -estring(9083,PRId*)
+ -estring(9083,PRIe*)
+ -estring(9083,PRIf*)
+ -estring(9083,PRIg*)
+ -estring(9083,PRIh*)
+ -estring(9083,PRIi*)
+ -estring(9083,PRIj*)
+ -estring(9083,PRIk*)
+ -estring(9083,PRIl*)
+ -estring(9083,PRIm*)
+ -estring(9083,PRIn*)
+ -estring(9083,PRIo*)
+ -estring(9083,PRIp*)
+ -estring(9083,PRIq*)
+ -estring(9083,PRIr*)
+ -estring(9083,PRIs*)
+ -estring(9083,PRIt*)
+ -estring(9083,PRIu*)
+ -estring(9083,PRIv*)
+ -estring(9083,PRIw*)
+ -estring(9083,PRIx*)
+ -estring(9083,PRIy*)
+ -estring(9083,PRIz*)
+ -estring(9083,PRIX*)
+ -estring(9083,SCNa*)
+ -estring(9083,SCNb*)
+ -estring(9083,SCNc*)
+ -estring(9083,SCNd*)
+ -estring(9083,SCNe*)
+ -estring(9083,SCNf*)
+ -estring(9083,SCNg*)
+ -estring(9083,SCNh*)
+ -estring(9083,SCNi*)
+ -estring(9083,SCNj*)
+ -estring(9083,SCNk*)
+ -estring(9083,SCNl*)
+ -estring(9083,SCNm*)
+ -estring(9083,SCNn*)
+ -estring(9083,SCNo*)
+ -estring(9083,SCNp*)
+ -estring(9083,SCNq*)
+ -estring(9083,SCNr*)
+ -estring(9083,SCNs*)
+ -estring(9083,SCNt*)
+ -estring(9083,SCNu*)
+ -estring(9083,SCNv*)
+ -estring(9083,SCNw*)
+ -estring(9083,SCNx*)
+ -estring(9083,SCNy*)
+ -estring(9083,SCNz*)
+ -estring(9083,SCNX*)
+
+/**** Rule 21.2 (Req) ************/
+
+ +e683 /* complain about #define standard functions */
+ +elib(683)
+ -append(683,[MISRA 2012 Rule 21.2, required])
+ /* Undefining standard library macros is covered by rule 20.5. */
+ /* Defining/redefining reserved/standard identifiers is covered
+ by rule 20.4 and 21.2.
+ */
+
+/**** Rule 21.3 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,calloc,[MISRA 2012 Rule 21.3, required])
+ -deprecate(macro,calloc,[MISRA 2012 Rule 21.3, required])
+ -deprecate(function,malloc,[MISRA 2012 Rule 21.3, required])
+ -deprecate(macro,malloc,[MISRA 2012 Rule 21.3, required])
+ -deprecate(function,realloc,[MISRA 2012 Rule 21.3, required])
+ -deprecate(macro,realloc,[MISRA 2012 Rule 21.3, required])
+ -deprecate(function,free,[MISRA 2012 Rule 21.3, required])
+ -deprecate(macro,free,[MISRA 2012 Rule 21.3, required])
+
+/**** Rule 21.4 (Req) ************/
+
+ +e829 /* warn on header usage */
+ +elib(829)
+ +headerwarn(setjmp.h)
+ -append(829(setjmp.h),[MISRA 2012 Rule 21.4, required])
+ -deprecate(function,setjmp,[MISRA 2012 Rule 21.4, required])
+ -deprecate(function,longjmp,[MISRA 2012 Rule 21.4, required])
+ -deprecate(macro,setjmp,[MISRA 2012 Rule 21.4, required])
+ -deprecate(macro,longjmp,[MISRA 2012 Rule 21.4, required])
+
+/**** Rule 21.5 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,signal,[MISRA 2012 Rule 21.5, required])
+ -deprecate(function,raise,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIGABRT,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIGFPE,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIGILL,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIGINT,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIGSEGV,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIGTERM,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIG_DFL,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIG_ERR,[MISRA 2012 Rule 21.5, required])
+ -deprecate(macro,SIG_IGN,[MISRA 2012 Rule 21.5, required])
+ +e829 /* warn on header usage */
+ +elib(829)
+ +headerwarn(signal.h)
+ -append(829(signal.h),[MISRA 2012 Rule 21.5, required])
+
+/**** Rule 21.6 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,clearerr,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fclose,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,feof,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,ferror,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fflush,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fgetc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fgetpos,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fgets,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fgetwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fgetws,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fopen,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fputc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fputs,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fputwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fputws,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fread,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fseek,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fsetpos,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,freopen,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,ftell,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fwide,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fwprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fwrite,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,fwscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,getc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,getchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,gets,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,getwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,getwchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,perror,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,printf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,putc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,putchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,puts,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,putwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,putwchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,remove,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,rename,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,rewind,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,scanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,setbuf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,setvbuf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,snprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,sprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,sscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,swprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,swscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,tmpfile,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,tmpnam,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,ungetc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,ungetwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vfprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vfscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vfwprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vfwscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vsnprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vsprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vsscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vswprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vswscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vwprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,vwscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,wprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(function,wscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,clearerr,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fclose,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,feof,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,ferror,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fflush,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fgetc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fgets,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fgetpos,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fgetwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fgetws,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fopen,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fputc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fputs,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fputwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fputws,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fread,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fseek,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fsetpos,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,freopen,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,ftell,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fwide,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fwprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fwrite,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,fwscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,getc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,getchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,gets,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,getwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,getwchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,perror,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,printf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,putc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,putchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,puts,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,putwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,putwchar,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,remove,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,rename,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,rewind,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,scanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,setbuf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,setvbuf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,snprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,sprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,sscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,swprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,swscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,tmpfile,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,tmpnam,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,ungetc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,ungetwc,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vfprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vfscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vfwprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vfwscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vsnprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vsprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vsscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vswprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vswscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vwprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,vwscanf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,wprintf,[MISRA 2012 Rule 21.6, required])
+ -deprecate(macro,wscanf,[MISRA 2012 Rule 21.6, required])
+
+/**** Rule 21.7 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,atof,[MISRA 2012 Rule 21.7, required])
+ -deprecate(function,atoi,[MISRA 2012 Rule 21.7, required])
+ -deprecate(function,atol,[MISRA 2012 Rule 21.7, required])
+ -deprecate(function,atoll,[MISRA 2012 Rule 21.7, required])
+ -deprecate(macro,atof,[MISRA 2012 Rule 21.7, required])
+ -deprecate(macro,atoi,[MISRA 2012 Rule 21.7, required])
+ -deprecate(macro,atol,[MISRA 2012 Rule 21.7, required])
+ -deprecate(macro,atoll,[MISRA 2012 Rule 21.7, required])
+
+/**** Rule 21.8 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,abort,[MISRA 2012 Rule 21.8, required])
+ -deprecate(function,exit,[MISRA 2012 Rule 21.8, required])
+ -deprecate(function,getenv,[MISRA 2012 Rule 21.8, required])
+ -deprecate(function,system,[MISRA 2012 Rule 21.8, required])
+ -deprecate(macro,abort,[MISRA 2012 Rule 21.8, required])
+ -deprecate(macro,exit,[MISRA 2012 Rule 21.8, required])
+ -deprecate(macro,getenv,[MISRA 2012 Rule 21.8, required])
+ -deprecate(macro,system,[MISRA 2012 Rule 21.8, required])
+
+/**** Rule 21.9 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,bsearch,[MISRA 2012 Rule 21.9, required])
+ -deprecate(function,qsort,[MISRA 2012 Rule 21.9, required])
+ -deprecate(macro,bsearch,[MISRA 2012 Rule 21.9, required])
+ -deprecate(macro,qsort,[MISRA 2012 Rule 21.9, required])
+
+/**** Rule 21.10 (Req) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(macro,wcsftime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,wcsftime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,clock,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,clock,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,difftime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,difftime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,mktime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,mktime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,time,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,time,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,asctime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,asctime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,ctime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,ctime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,gmtime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,gmtime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,localtime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,localtime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,strftime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(function,strftime,[MISRA 2012 Rule 21.10, required])
+ -deprecate(macro,CLOCKS_PER_SEC,[MISRA 2012 Rule 21.10, required])
+ +e829 /* warn on header usage */
+ +elib(829)
+ +headerwarn(time.h)
+ -append(829(time.h),[MISRA 2012 Rule 21.10, required])
+
+/**** Rule 21.11 (Req) ************/
+
+ +e829 /* warn on header usage */
+ +elib(829)
+ +headerwarn(tgmath.h)
+ -append(829(tgmath.h),[MISRA 2012 Rule 21.11, required])
+
+/**** Rule 21.12 (Adv) ************/
+
+ +e586 /* Symbol is deprecated */
+ +elib(586)
+ -deprecate(function,feclearexcept,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,feclearexcept,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(function,fegetexceptflag,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,fegetexceptflag,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(function,feraiseexcept,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,feraiseexcept,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(function,fesetexceptflag,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,fesetexceptflag,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(function,fetestexcept,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,fetestexcept,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,FE_INEXACT,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,FE_DIVBYZERO,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,FE_UNDERFLOW,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,FE_OVERFLOW,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,FE_INVALID,[MISRA 2012 Rule 21.12, advisory])
+ -deprecate(macro,FE_ALL_EXCEPT,[MISRA 2012 Rule 21.12, advisory])
+
+/**** Rule 22.1 (Req) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e429 /* custodial pointer neither free'd nor returned */
+ +elib(429)
+ -append(429,[MISRA 2012 Rule 22.1, required])
+ -function_pair(fopen,fclose)
+ +e480 /* no balancing call */
+ +elib(480)
+ -append(480,[MISRA 2012 Rule 22.1, required])
+ +e481 /* different balance call states */
+ +elib(481)
+ -append(481,[MISRA 2012 Rule 22.1, required])
+
+/**** Rule 22.2 (Mand) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e424 /* inappropriate deallocation */
+ +elib(424)
+ -append(424,[MISRA 2012 Rule 22.2, mandatory])
+ +e449 /* pointer previously deallocated */
+ +elib(449)
+ -append(449,[MISRA 2012 Rule 22.2, mandatory])
+
+/**** Rule 22.3 (Req) ************/
+
+ /* MISRA has declared this rule to be "undecidable". */
+
+/**** Rule 22.4 (Mand) ************/
+
+ /* MISRA has declared this rule to be "undecidable". */
+
+/**** Rule 22.5 (Mand) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ Software provides the following message to assist:
+ */
+ +e9047 /* FILE pointer dereferenced */
+ +elib(9047)
+ -append(9047,[MISRA 2012 Rule 22.5, mandatory])
+
+
+/**** Rule 22.6 (Mand) ************/
+
+ /* While MISRA has declared this rule to be "undecidable", Gimpel
+ * Software provides the following options to assist:
+ */
+ +e449 /* previously deallocated pointer */
+ +elib(449)
+ -append(449,[MISRA 2012 Rule 22.6, mandatory])
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.h b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.h
new file mode 100644
index 000000000..d18d71e57
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.h
@@ -0,0 +1,129 @@
+// ---------------------------------------------------------------------
+// This file is provided by Gimpel Software (www.gimpel.com) for use with
+// its products PC-lint and FlexeLint.
+//
+// Redistribution and use of this file, with or without modification, is
+// permitted provided that any such redistribution retains this notice.
+// ---------------------------------------------------------------------
+
+#ifndef CO_GCC_H_
+#define CO_GCC_H_
+/*lint -save -w1 */
+
+#ifdef _lint /* Make sure no compiler comes this way */
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Standard library headers typically define the assert macro so that it
+ expands to a complicated conditional expression that uses special
+ funtions that Lint does not know about by default. For linting
+ purposes, we can simplify things a bit by forcing assert() to expand to
+ a call to a special function that has the appropriate 'assert'
+ semantics.
+ */
+//lint -function( __assert, __lint_assert )
+void __lint_assert( int );
+//lint ++d"assert(e)=__lint_assert(!!(e))"
+//(++d makes this definition permanently immutable for the Lint run.)
+//Now that we've made our own 'assert', we need to keep people from being
+//punished when the marco in 'assert.h' appears not to be used:
+//lint -efile(766,*assert.h)
+
+typedef char *__builtin_va_list;
+
+/*lint -e{171} */
+__builtin_va_list __lint_init_va(...);
+
+void __builtin_va_end( __builtin_va_list );
+ /*lint
+++d"__builtin_va_start(ap,parmN)=((ap)=__lint_init_va(parmN))"
+++d"__builtin_va_arg(a,b)=(*( ((b) *) ( (((a) += sizeof(b)) - sizeof(b) )))"
+ */
+
+
+/*
+ The headers included below must be generated; For C++, generate
+ with:
+
+ g++ [usual build options] -E -dM t.cpp >lint_cppmac.h
+
+ For C, generate with:
+
+ gcc [usual build options] -E -dM t.c >lint_cmac.h
+
+ ...where "t.cpp" and "t.c" are empty source files.
+
+ It's important to use the same compiler options used when compiling
+ project code because they can affect the existence and precise
+ definitions of certain predefined macros. See gcc-readme.txt for
+ details and a tutorial.
+ */
+#if defined(__cplusplus)
+# include "lint_cppmac.h" // DO NOT COMMENT THIS OUT. DO NOT SUPPRESS ERROR 322. (If you see an error here, your Lint configuration is broken; check -i options and ensure that you have generated lint_cppmac.h as documented in gcc-readme.txt. Otherwise Gimpel Software cannot support your configuration.)
+#else
+# include "lint_cmac.h" // DO NOT COMMENT THIS OUT. DO NOT SUPPRESS ERROR 322. (If you see an error here, your Lint configuration is broken; check -i options and ensure that you have generated lint_cmac.h as documented in gcc-readme.txt. Otherwise Gimpel Software cannot support your configuration.)
+#endif
+
+/* If the macro set given by the generated macro files must be adjusted in
+ order for Lint to cope, then you can make those adjustments here.
+ */
+
+#define LINT_CO_GCC_H_GCC_VERSION ( __GNUC__ * 10000 + \
+ __GNUC_MINOR__ * 100 + \
+ __GNUC_PATCHLEVEL__ )
+
+/* The following is a workaround for versions of GCC with bug 25717, in
+ which the preprocessor does not dump a #define directive for __STDC__
+ when -dM is given:
+ http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25717
+
+ We know the unconditional definition of __STDC__ was introduced no
+ later than version 3.0; the preprocessor bug was fixed no later than
+ version 4.1.0.
+ */
+#if ( LINT_CO_GCC_H_GCC_VERSION >= 30000 && \
+ LINT_CO_GCC_H_GCC_VERSION < 40100 )
+# define __STDC__ 1
+#endif
+
+#if !__cplusplus && !__STRICT_ANSI__ && __STDC_VERSION__ < 199901L
+/* apparently, the code is compiled with -std=gnu89 (as opposed to -std=c89),
+ so: */
+/*lint -rw_asgn(inline,__inline) */
+#endif
+
+#if LINT_CO_GCC_H_GCC_VERSION >= 40300
+# define __COUNTER__ __lint__COUNTER__
+//lint +rw( *type_traits ) // Enable type traits support
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#if _lint >= 909 // For 9.00i and later:
+ //// __attribute__ is GCC's __attribute__:
+ //
+ //lint -rw_asgn(__attribute__,__gcc_attribute__)
+ //lint -rw_asgn(__attribute, __gcc_attribute__)
+ //
+ //// Prevent "__attribute__" from being defined as a macro:
+ //
+ //lint --u"__attribute__"
+ //lint --u"__attribute"
+ //
+ //// Because an attribute-specifier is a form of
+ //// declaration-modifier, and because it can appear at the
+ //// beginning of a decl-specifier-seq, we must enable "Early
+ //// Modifiers":
+ //
+ //lint +fem
+#else // for 9.00h and earlier:
+ //lint -d__attribute__()=
+ //lint -d__attribute()=
+#endif
+
+#endif /* _lint */
+/*lint -restore */
+#endif /* CO_GCC_H_ */
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.lnt b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.lnt
new file mode 100644
index 000000000..b7e1ed26b
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/co-gcc.lnt
@@ -0,0 +1,209 @@
+/* Date Stamp */ -d"_lint_co_gcc_lnt=co-gcc.lnt modified 12-Jun-2014"
+/* To document usage use: -message( "Using " _lint_co_gcc_lnt ) */
+// ---------------------------------------------------------------------
+// This file is provided by Gimpel Software (www.gimpel.com) for use with
+// its products PC-lint and FlexeLint.
+//
+// Redistribution and use of this file, with or without modification, is
+// permitted provided that any such redistribution retains this notice.
+// ---------------------------------------------------------------------
+/* co-gcc.lnt: This is the seed file for configuring Lint for use with
+ GCC versions 2.95.3 and later.
+
+ Like all compiler options files this file is intended to be used
+ as follows:
+
+ lint co-gcc.lnt source-files-to-be-linted
+
+ Some of the information that co-gcc.lnt requires needs to be furnished
+ with the help of the gcc system itself. The easiest way to generate
+ this information is to use the makefile co-gcc.mak (supplied with the
+ Lint distribution) in an invocation of GNU Make; for details, see the
+ commentary at the top of co-gcc.mak.
+*/
+
+-cgnu // Notifies FlexeLint that gcc is being used.
+
+// ===========================
+// Preprocessor Configuration:
++fdi // GCC starts its #include search in the directory of the including
+ // file.
+
+++fln // Allow:
+ // # digit-sequence " [s-char-sequence] " new-line
+ // as a synonym for:
+ // # line digit-sequence " [s-char-sequence] " new-line
+ // GCC additionally allows flag values to follow the
+ // s-char-sequence, but currently Lint ignores them.
+
+-header(pclint/co-gcc.h) // Includes headers generated by GCC (bringing in
+ // predefined macros).
++libh(pclint/co-gcc.h) // Marks that header as library code.
+
+pclint/gcc-include-path.lnt // This .lnt file should contain --i options
+ // and should be generated by invoking gcc with its '-v' option.
+ // (GCC's implicit #include search path is presented in the output.)
+ // This happens automatically when 'make -f co-gcc.mak' is invoked.
+
+// Assertion directives (a feature of GCC's preprocessor) have been
+// considered obsolete in GCC's documentation since version 3.0, so we do
+// not use them here. If support for #assert is needed in the form of a
+// lint option, one may use '-a#' like so:
+// -a#machine(i386) // #assert's machine(i386) (SVR4 facility).
+
+// File extensions:
+// From the GCC man page:
+//
+// file.cc
+// file.cp
+// file.cxx
+// file.cpp
+// file.CPP
+// file.c++
+// file.C
+// C++ source code that must be preprocessed. Note that in .cxx, the
+// last two letters must both be literally x. Likewise, .C refers to
+// a literal capital C.
+//
+// We emulate this with:
+
+ +cpp(.cc)
+ +cpp(.cp)
+ +cpp(.cxx)
+ +cpp(.cpp)
+ +cpp(.c++)
+ // Note the exceptions:
+ // +cpp(.CPP)
+ // +cpp(.C)
+ // These are commented out for the default config because they seem to
+ // cause trouble more often than not. For starters, it is problematic
+ // with filesystems that are case-insensitive (which has become common
+ // even on some POSIX systems).
+
+// =============
+// Size Options:
+// +fwc // wchar_t might be builtin; if so, uncomment this option. (NOTE:
+// // this option needs to be set before a size option is given for
+// // wchar_t; see the documentation for -sw# in the Lint manual.)
+
+pclint/size-options.lnt // This .lnt file should be generated (preferrably
+ // by a program created by invoking GCC with the compile options that
+ // are used in the compilation of the project to be linted). This
+ // happens automatically when 'make -f co-gcc.mak' is invoked.
+
+
+// ===========================================
+// +rw and -d options to cope with GNU syntax:
++ppw(ident) // Tolerate #ident
++ppw(warning)
+
+// GCC provides alternative spellings of certain keywords:
++rw(__inline)
+-rw_asgn(__inline__,__inline)
+-rw_asgn(__header_always_inline,__inline)
+-rw_asgn(__header_inline,__inline)
+
+-rw_asgn(__signed__,signed)
+-rw_asgn(__signed,signed)
+-rw_asgn( __volatile__, volatile )
+-rw_asgn( __volatile, volatile )
++rw(restrict)
+-rw_asgn(__restrict,restrict)
+-rw_asgn(__restrict__,restrict)
+++d"__const=const" // gconv.h uses __const rather than const
+++d"const=const" // ensure const expands to const.
+
+-rw_asgn( asm, _up_to_brackets )
+-rw_asgn( __asm, _up_to_brackets )
+-rw_asgn( __asm__, _up_to_brackets )
+// This re-definition of the various spellings of the asm keyword enables
+// Lint to pass gracefully over expression-statements like:
+// __asm __volatile ("fsqrt" : "=t" (__result) : "0" (__x));
+// But it may be necessary to suppress certain error messages that are
+// triggered by tokens that are part of an assembly declaration or
+// statement. For example:
+
+// -d"__asm__(p...)=/*lint -e{19}*/ __asm__(p)"
+
+// ...causes Lint to be quiet about the semicolon that follows an
+// __asm__() declaration. Note, the -e{N} form of suppression takes
+// effect only for the forward-declaration, definition or
+// [possibly-compound] statement that immediately follows. Because a
+// semicolon is seen as a declaration-terminator, Error 19 will be
+// re-enabled immediately after the semicolon in '__asm__(...);'.
+// (The elipsis after the macro parameter p allows zero or more commas to
+// appear in the operand.)
+//
+// If you encounter other diagnostics that appear to need suppression in
+// or near assembly regions, please let us know!
+//
+-esym(123,__asm__)
+
+-rw_asgn(__alignof__,__alignof)
+
+// "__extension__" is GCC's way of allowing the use of non-standard
+// constructs in a strict Standard-conforming mode. We don't currently
+// have explicit support for it, but we can use local suppressions. For
+// example, we can use -e(160) so that we will not see any Errors about
+// GNU statement-expressions wrapped in __extension__().
+++d"__extension__=/*lint -e(160) */"
+
+++d"__null=0"
++rw(_to_semi) // needed for the two macros above.
++rw(__typeof__) // activate __typeof__ keyword
+-d"__typeof=__typeof__" // an alternative to using __typeof__
+
+-rw(__except) // This MS reserved word is used as an identifier
++rw( __complex__, __real__, __imag__ ) // reserved words that can be ignored.
+++d"__builtin_strchr=(char*)" // permits the inline definition ...
+++d"__builtin_strpbrk=(char*)" // of these functions to be linted ...
+++d"__builtin_strrchr=(char*)" // without drawing a complaint
+++d"__builtin_strstr=(char*)" // about the use of a non-standard name
+++d"__PRETTY_FUNCTION__=___function___" // lint defines ___function___ internally
+++d"__FUNCTION__=___function___" // lint defines ___function___ internally
+++d"__func__=___function___" // Some C++ modes suport the implicit __func__
+ // identifier.
+-ident($)
+
+// =========================================================
+// Other options supporting GNU C/C++ syntax:
++fld // enables the processing of _L_abel _D_esignators E.g.:
+ // union { double d; int i; } u = { d: 3.141 };
+
+// =========================================================
+// Generally useful suppressions:
+-wlib(1) // sets the warning level within library headers to 1
+ // (no warnings, just syntax errors). Comment out if you
+ // are actually linting library headers.
+-elib(123) // 123 is really a warning, but it's in the "Error" range.
+-elib(93) // allow newlines within quoted string arguments to macros
+-elib(46) // allow bit fields to have integral types other than
+ // '_Bool' and 'int'.
+-elibsym(628) // Suppress 628 for __builtin symbols.
+
+-esym(528,__huge_val,__nan,__qnan,__qnanf,__snan,__snanf)
+ // We don't care if we don't reference some GNU functions
+-esym(528,__gnu_malloc,__gnu_calloc)
+
+// The following functions exhibit variable return modes.
+// That is, they may equally-usefully be called for a value
+// as called just for their effects. Accordingly we inhibit
+// Warning 534 for these functions.
+// Feel free to add to or subtract from this list.
+
+-esym(534,close,creat,fclose,fprintf,fputc)
+-esym(534,fputs,fscanf,fseek,fwrite,lseek,memcpy,memmove,memset)
+-esym(534,printf,puts,scanf,sprintf,sscanf,strcat,strcpy)
+-esym(534,strncat,strncpy,unlink,write)
+
+// For non-ANSI compilers we suppress messages 515 and 516
+// for functions known to have variable argument lists.
+// For ANSI compilers, header files should take care of this.
+
+-esym(515,fprintf,printf,sprintf,fscanf,scanf,sscanf)
+-esym(516,fprintf,printf,sprintf,fscanf,scanf,sscanf)
+-esym(1702,*operator<<,*operator>>)
+-esym(534,*operator<<,*operator>>)
+-esym(1055,*__builtin*)
+-esym(718,*__builtin*) // The compiler does not need these ...
+-esym(746,*__builtin*) // declared and it knows their prototypes.
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/gcc-include-path.lnt b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/gcc-include-path.lnt
new file mode 100644
index 000000000..2f5b335c1
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/gcc-include-path.lnt
@@ -0,0 +1,6 @@
+--i"c:\programmi\gnu tools arm embedded\4.7 2013q3\bin\../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/include/c++/4.7.4"
+--i"c:\programmi\gnu tools arm embedded\4.7 2013q3\bin\../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/include/c++/4.7.4/arm-none-eabi"
+--i"c:\programmi\gnu tools arm embedded\4.7 2013q3\bin\../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/include/c++/4.7.4/backward"
+--i"c:\programmi\gnu tools arm embedded\4.7 2013q3\bin\../lib/gcc/arm-none-eabi/4.7.4/include"
+--i"c:\programmi\gnu tools arm embedded\4.7 2013q3\bin\../lib/gcc/arm-none-eabi/4.7.4/include-fixed"
+--i"c:\programmi\gnu tools arm embedded\4.7 2013q3\bin\../lib/gcc/arm-none-eabi/4.7.4/../../../../arm-none-eabi/include"
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cmac.h b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cmac.h
new file mode 100644
index 000000000..3d0ae4bb7
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cmac.h
@@ -0,0 +1,330 @@
+#define __DBL_MIN_EXP__ (-1021)
+#define __HQ_FBIT__ 15
+#define __UINT_LEAST16_MAX__ 65535
+#define __ATOMIC_ACQUIRE 2
+#define __SFRACT_IBIT__ 0
+#define __FLT_MIN__ 1.1754943508222875e-38F
+#define __UFRACT_MAX__ 0XFFFFP-16UR
+#define __UINT_LEAST8_TYPE__ unsigned char
+#define __DQ_FBIT__ 63
+#define __INTMAX_C(c) c ## LL
+#define __ULFRACT_FBIT__ 32
+#define __SACCUM_EPSILON__ 0x1P-7HK
+#define __CHAR_BIT__ 8
+#define __USQ_IBIT__ 0
+#define __UINT8_MAX__ 255
+#define __ACCUM_FBIT__ 15
+#define __WINT_MAX__ 4294967295U
+#define __USFRACT_FBIT__ 8
+#define __ORDER_LITTLE_ENDIAN__ 1234
+#define __SIZE_MAX__ 4294967295U
+#define __WCHAR_MAX__ 4294967295U
+#define __LACCUM_IBIT__ 32
+#define __DBL_DENORM_MIN__ ((double)4.9406564584124654e-324L)
+#define __GCC_ATOMIC_CHAR_LOCK_FREE 1
+#define __FLT_EVAL_METHOD__ 0
+#define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK
+#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 1
+#define __FRACT_FBIT__ 15
+#define __UINT_FAST64_MAX__ 18446744073709551615ULL
+#define __SIG_ATOMIC_TYPE__ int
+#define __UACCUM_FBIT__ 16
+#define __DBL_MIN_10_EXP__ (-307)
+#define __FINITE_MATH_ONLY__ 0
+#define __ARMEL__ 1
+#define __LFRACT_IBIT__ 0
+#define __GNUC_PATCHLEVEL__ 4
+#define __LFRACT_MAX__ 0X7FFFFFFFP-31LR
+#define __UINT_FAST8_MAX__ 4294967295U
+#define __DEC64_MAX_EXP__ 385
+#define __INT8_C(c) c
+#define __UINT_LEAST64_MAX__ 18446744073709551615ULL
+#define __SA_FBIT__ 15
+#define __SHRT_MAX__ 32767
+#define __LDBL_MAX__ 1.7976931348623157e+308L
+#define __FRACT_MAX__ 0X7FFFP-15R
+#define __UFRACT_FBIT__ 16
+#define __UFRACT_MIN__ 0.0UR
+#define __UINT_LEAST8_MAX__ 255
+#define __GCC_ATOMIC_BOOL_LOCK_FREE 1
+#define __UINTMAX_TYPE__ long long unsigned int
+#define __LLFRACT_EPSILON__ 0x1P-63LLR
+#define __DEC32_EPSILON__ 1E-6DF
+#define __CHAR_UNSIGNED__ 1
+#define __UINT32_MAX__ 4294967295UL
+#define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR
+#define __TA_IBIT__ 64
+#define __LDBL_MAX_EXP__ 1024
+#define __WINT_MIN__ 0U
+#define __ULLFRACT_MIN__ 0.0ULLR
+#define __SCHAR_MAX__ 127
+#define __WCHAR_MIN__ 0U
+#define __INT64_C(c) c ## LL
+#define __DBL_DIG__ 15
+#define __GCC_ATOMIC_POINTER_LOCK_FREE 1
+#define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK)
+#define __SIZEOF_INT__ 4
+#define __SIZEOF_POINTER__ 4
+#define __USACCUM_IBIT__ 8
+#define __USER_LABEL_PREFIX__
+#define __STDC_HOSTED__ 1
+#define __LDBL_HAS_INFINITY__ 1
+#define __LFRACT_MIN__ (-0.5LR-0.5LR)
+#define __HA_IBIT__ 8
+#define __TQ_IBIT__ 0
+#define __FLT_EPSILON__ 1.1920928955078125e-7F
+#define __APCS_32__ 1
+#define __USFRACT_IBIT__ 0
+#define __LDBL_MIN__ 2.2250738585072014e-308L
+#define __FRACT_MIN__ (-0.5R-0.5R)
+#define __DEC32_MAX__ 9.999999E96DF
+#define __DA_IBIT__ 32
+#define __INT32_MAX__ 2147483647L
+#define __UQQ_FBIT__ 8
+#define __SIZEOF_LONG__ 4
+#define __UACCUM_MAX__ 0XFFFFFFFFP-16UK
+#define __UINT16_C(c) c
+#define __DECIMAL_DIG__ 17
+#define __LFRACT_EPSILON__ 0x1P-31LR
+#define __ULFRACT_MIN__ 0.0ULR
+#define __LDBL_HAS_QUIET_NAN__ 1
+#define __ULACCUM_IBIT__ 32
+#define __UACCUM_EPSILON__ 0x1P-16UK
+#define __GNUC__ 4
+#define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK
+#define __HQ_IBIT__ 0
+#define __FLT_HAS_DENORM__ 1
+#define __SIZEOF_LONG_DOUBLE__ 8
+#define __BIGGEST_ALIGNMENT__ 8
+#define __DQ_IBIT__ 0
+#define __DBL_MAX__ ((double)1.7976931348623157e+308L)
+#define __ULFRACT_IBIT__ 0
+#define __INT_FAST32_MAX__ 2147483647
+#define __DBL_HAS_INFINITY__ 1
+#define __ACCUM_IBIT__ 16
+#define __DEC32_MIN_EXP__ (-94)
+#define __THUMB_INTERWORK__ 1
+#define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK
+#define __INT_FAST16_TYPE__ int
+#define __LDBL_HAS_DENORM__ 1
+#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
+#define __INT_LEAST32_MAX__ 2147483647L
+#define __ARM_PCS 1
+#define __DEC32_MIN__ 1E-95DF
+#define __ACCUM_MAX__ 0X7FFFFFFFP-15K
+#define __DBL_MAX_EXP__ 1024
+#define __USACCUM_EPSILON__ 0x1P-8UHK
+#define __DEC128_EPSILON__ 1E-33DL
+#define __SFRACT_MAX__ 0X7FP-7HR
+#define __FRACT_IBIT__ 0
+#define __PTRDIFF_MAX__ 2147483647
+#define __UACCUM_MIN__ 0.0UK
+#define __UACCUM_IBIT__ 16
+#define __LONG_LONG_MAX__ 9223372036854775807LL
+#define __SIZEOF_SIZE_T__ 4
+#define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK
+#define __SIZEOF_WINT_T__ 4
+#define __SA_IBIT__ 16
+#define __ULLACCUM_MIN__ 0.0ULLK
+#define __GXX_ABI_VERSION 1002
+#define __UTA_FBIT__ 64
+#define __SOFTFP__ 1
+#define __FLT_MIN_EXP__ (-125)
+#define __USFRACT_MAX__ 0XFFP-8UHR
+#define __UFRACT_IBIT__ 0
+#define __INT_FAST64_TYPE__ long long int
+#define __DBL_MIN__ ((double)2.2250738585072014e-308L)
+#define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK)
+#define __ULLACCUM_FBIT__ 32
+#define __GXX_TYPEINFO_EQUALITY_INLINE 0
+#define __ULLFRACT_EPSILON__ 0x1P-64ULLR
+#define __USES_INITFINI__ 1
+#define __DEC128_MIN__ 1E-6143DL
+#define __REGISTER_PREFIX__
+#define __UINT16_MAX__ 65535
+#define __DBL_HAS_DENORM__ 1
+#define __ACCUM_MIN__ (-0X1P15K-0X1P15K)
+#define __SQ_IBIT__ 0
+#define __UINT8_TYPE__ unsigned char
+#define __UHA_FBIT__ 8
+#define __NO_INLINE__ 1
+#define __SFRACT_MIN__ (-0.5HR-0.5HR)
+#define __UTQ_FBIT__ 128
+#define __FLT_MANT_DIG__ 24
+#define __VERSION__ "4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601]"
+#define __UINT64_C(c) c ## ULL
+#define __ULLFRACT_FBIT__ 64
+#define __FRACT_EPSILON__ 0x1P-15R
+#define __ULACCUM_MIN__ 0.0ULK
+#define __UDA_FBIT__ 32
+#define __LLACCUM_EPSILON__ 0x1P-31LLK
+#define __GCC_ATOMIC_INT_LOCK_FREE 1
+#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __USFRACT_MIN__ 0.0UHR
+#define __UQQ_IBIT__ 0
+#define __INT32_C(c) c ## L
+#define __DEC64_EPSILON__ 1E-15DD
+#define __ORDER_PDP_ENDIAN__ 3412
+#define __DEC128_MIN_EXP__ (-6142)
+#define __UHQ_FBIT__ 16
+#define __LLACCUM_FBIT__ 31
+#define __INT_FAST32_TYPE__ int
+#define __UINT_LEAST16_TYPE__ short unsigned int
+#define __INT16_MAX__ 32767
+#define __SIZE_TYPE__ unsigned int
+#define __UINT64_MAX__ 18446744073709551615ULL
+#define __UDQ_FBIT__ 64
+#define __INT8_TYPE__ signed char
+#define __ELF__ 1
+#define __ULFRACT_EPSILON__ 0x1P-32ULR
+#define __LLFRACT_FBIT__ 63
+#define __FLT_RADIX__ 2
+#define __INT_LEAST16_TYPE__ short int
+#define __LDBL_EPSILON__ 2.2204460492503131e-16L
+#define __UINTMAX_C(c) c ## ULL
+#define __SACCUM_MAX__ 0X7FFFP-7HK
+#define __SIG_ATOMIC_MAX__ 2147483647
+#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 1
+#define __VFP_FP__ 1
+#define __SIZEOF_PTRDIFF_T__ 4
+#define __LACCUM_EPSILON__ 0x1P-31LK
+#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
+#define __INT_FAST16_MAX__ 2147483647
+#define __UINT_FAST32_MAX__ 4294967295U
+#define __UINT_LEAST64_TYPE__ long long unsigned int
+#define __USACCUM_MAX__ 0XFFFFP-8UHK
+#define __SFRACT_EPSILON__ 0x1P-7HR
+#define __FLT_HAS_QUIET_NAN__ 1
+#define __FLT_MAX_10_EXP__ 38
+#define __LONG_MAX__ 2147483647L
+#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
+#define __FLT_HAS_INFINITY__ 1
+#define __USA_FBIT__ 16
+#define __UINT_FAST16_TYPE__ unsigned int
+#define __DEC64_MAX__ 9.999999999999999E384DD
+#define __CHAR16_TYPE__ short unsigned int
+#define __PRAGMA_REDEFINE_EXTNAME 1
+#define __INT_LEAST16_MAX__ 32767
+#define __DEC64_MANT_DIG__ 16
+#define __INT64_MAX__ 9223372036854775807LL
+#define __UINT_LEAST32_MAX__ 4294967295UL
+#define __SACCUM_FBIT__ 7
+#define __GCC_ATOMIC_LONG_LOCK_FREE 1
+#define __INT_LEAST64_TYPE__ long long int
+#define __INT16_TYPE__ short int
+#define __INT_LEAST8_TYPE__ signed char
+#define __SQ_FBIT__ 31
+#define __DEC32_MAX_EXP__ 97
+#define __INT_FAST8_MAX__ 2147483647
+#define __INTPTR_MAX__ 2147483647
+#define __QQ_FBIT__ 7
+#define __UTA_IBIT__ 64
+#define __LDBL_MANT_DIG__ 53
+#define __SFRACT_FBIT__ 7
+#define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK)
+#define __DBL_HAS_QUIET_NAN__ 1
+#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
+#define __INTPTR_TYPE__ int
+#define __UINT16_TYPE__ short unsigned int
+#define __WCHAR_TYPE__ unsigned int
+#define __SIZEOF_FLOAT__ 4
+#define __USQ_FBIT__ 32
+#define __UINTPTR_MAX__ 4294967295U
+#define __DEC64_MIN_EXP__ (-382)
+#define __ULLACCUM_IBIT__ 32
+#define __INT_FAST64_MAX__ 9223372036854775807LL
+#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
+#define __FLT_DIG__ 6
+#define __UINT_FAST64_TYPE__ long long unsigned int
+#define __INT_MAX__ 2147483647
+#define __LACCUM_FBIT__ 31
+#define __USACCUM_MIN__ 0.0UHK
+#define __UHA_IBIT__ 8
+#define __INT64_TYPE__ long long int
+#define __FLT_MAX_EXP__ 128
+#define __UTQ_IBIT__ 0
+#define __DBL_MANT_DIG__ 53
+#define __INT_LEAST64_MAX__ 9223372036854775807LL
+#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 1
+#define __DEC64_MIN__ 1E-383DD
+#define __WINT_TYPE__ unsigned int
+#define __UINT_LEAST32_TYPE__ long unsigned int
+#define __SIZEOF_SHORT__ 2
+#define __ULLFRACT_IBIT__ 0
+#define __LDBL_MIN_EXP__ (-1021)
+#define __arm__ 1
+#define __UDA_IBIT__ 32
+#define __INT_LEAST8_MAX__ 127
+#define __LFRACT_FBIT__ 31
+#define __LDBL_MAX_10_EXP__ 308
+#define __ATOMIC_RELAXED 0
+#define __DBL_EPSILON__ ((double)2.2204460492503131e-16L)
+#define __UINT8_C(c) c
+#define __INT_LEAST32_TYPE__ long int
+#define __SIZEOF_WCHAR_T__ 4
+#define __UINT64_TYPE__ long long unsigned int
+#define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR
+#define __TQ_FBIT__ 127
+#define __INT_FAST8_TYPE__ int
+#define __ULLACCUM_EPSILON__ 0x1P-32ULLK
+#define __UHQ_IBIT__ 0
+#define __LLACCUM_IBIT__ 32
+#define __DBL_DECIMAL_DIG__ 17
+#define __DEC_EVAL_METHOD__ 2
+#define __TA_FBIT__ 63
+#define __UDQ_IBIT__ 0
+#define __ORDER_BIG_ENDIAN__ 4321
+#define __ACCUM_EPSILON__ 0x1P-15K
+#define __UINT32_C(c) c ## UL
+#define __INTMAX_MAX__ 9223372036854775807LL
+#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
+#define __LLFRACT_IBIT__ 0
+#define __INT8_MAX__ 127
+#define __UINT_FAST32_TYPE__ unsigned int
+#define __CHAR32_TYPE__ long unsigned int
+#define __FLT_MAX__ 3.4028234663852886e+38F
+#define __USACCUM_FBIT__ 8
+#define __INT32_TYPE__ long int
+#define __SIZEOF_DOUBLE__ 8
+#define __FLT_MIN_10_EXP__ (-37)
+#define __UFRACT_EPSILON__ 0x1P-16UR
+#define __INTMAX_TYPE__ long long int
+#define __DEC128_MAX_EXP__ 6145
+#define __ATOMIC_CONSUME 1
+#define __GNUC_MINOR__ 7
+#define __UINTMAX_MAX__ 18446744073709551615ULL
+#define __DEC32_MANT_DIG__ 7
+#define __HA_FBIT__ 7
+#define __DBL_MAX_10_EXP__ 308
+#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
+#define __INT16_C(c) c
+#define __STDC__ 1
+#define __ARM_ARCH_4T__ 1
+#define __PTRDIFF_TYPE__ int
+#define __LLFRACT_MIN__ (-0.5LLR-0.5LLR)
+#define __ATOMIC_SEQ_CST 5
+#define __DA_FBIT__ 31
+#define __UINT32_TYPE__ long unsigned int
+#define __UINTPTR_TYPE__ unsigned int
+#define __USA_IBIT__ 16
+#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
+#define __ARM_EABI__ 1
+#define __DEC128_MANT_DIG__ 34
+#define __LDBL_MIN_10_EXP__ (-307)
+#define __SIZEOF_LONG_LONG__ 8
+#define __ULACCUM_EPSILON__ 0x1P-32ULK
+#define __SACCUM_IBIT__ 8
+#define __GCC_ATOMIC_LLONG_LOCK_FREE 1
+#define __LDBL_DIG__ 15
+#define __FLT_DECIMAL_DIG__ 9
+#define __UINT_FAST16_MAX__ 4294967295U
+#define __GNUC_GNU_INLINE__ 1
+#define __GCC_ATOMIC_SHORT_LOCK_FREE 1
+#define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR
+#define __UINT_FAST8_TYPE__ unsigned int
+#define __USFRACT_EPSILON__ 0x1P-8UHR
+#define __ULACCUM_FBIT__ 32
+#define __QQ_IBIT__ 0
+#define __ATOMIC_ACQ_REL 4
+#define __ATOMIC_RELEASE 3
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cppmac.h b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cppmac.h
new file mode 100644
index 000000000..5e63a1f3b
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/lint_cppmac.h
@@ -0,0 +1,336 @@
+#define __DBL_MIN_EXP__ (-1021)
+#define __HQ_FBIT__ 15
+#define __UINT_LEAST16_MAX__ 65535
+#define __ATOMIC_ACQUIRE 2
+#define __SFRACT_IBIT__ 0
+#define __FLT_MIN__ 1.1754943508222875e-38F
+#define __UFRACT_MAX__ 0XFFFFP-16UR
+#define __UINT_LEAST8_TYPE__ unsigned char
+#define __DQ_FBIT__ 63
+#define __INTMAX_C(c) c ## LL
+#define __ULFRACT_FBIT__ 32
+#define __SACCUM_EPSILON__ 0x1P-7HK
+#define __CHAR_BIT__ 8
+#define __USQ_IBIT__ 0
+#define __UINT8_MAX__ 255
+#define __ACCUM_FBIT__ 15
+#define __WINT_MAX__ 4294967295U
+#define __USFRACT_FBIT__ 8
+#define __ORDER_LITTLE_ENDIAN__ 1234
+#define __SIZE_MAX__ 4294967295U
+#define __WCHAR_MAX__ 4294967295U
+#define __LACCUM_IBIT__ 32
+#define __DBL_DENORM_MIN__ double(4.9406564584124654e-324L)
+#define __GCC_ATOMIC_CHAR_LOCK_FREE 1
+#define __FLT_EVAL_METHOD__ 0
+#define __LLACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LLK
+#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 1
+#define __FRACT_FBIT__ 15
+#define __UINT_FAST64_MAX__ 18446744073709551615ULL
+#define __SIG_ATOMIC_TYPE__ int
+#define __UACCUM_FBIT__ 16
+#define __DBL_MIN_10_EXP__ (-307)
+#define __FINITE_MATH_ONLY__ 0
+#define __ARMEL__ 1
+#define __LFRACT_IBIT__ 0
+#define __GNUC_PATCHLEVEL__ 4
+#define __LFRACT_MAX__ 0X7FFFFFFFP-31LR
+#define __UINT_FAST8_MAX__ 4294967295U
+#define __DEC64_MAX_EXP__ 385
+#define __INT8_C(c) c
+#define __UINT_LEAST64_MAX__ 18446744073709551615ULL
+#define __SA_FBIT__ 15
+#define __SHRT_MAX__ 32767
+#define __LDBL_MAX__ 1.7976931348623157e+308L
+#define __FRACT_MAX__ 0X7FFFP-15R
+#define __UFRACT_FBIT__ 16
+#define __UFRACT_MIN__ 0.0UR
+#define __UINT_LEAST8_MAX__ 255
+#define __GCC_ATOMIC_BOOL_LOCK_FREE 1
+#define __UINTMAX_TYPE__ long long unsigned int
+#define __LLFRACT_EPSILON__ 0x1P-63LLR
+#define __DEC32_EPSILON__ 1E-6DF
+#define __CHAR_UNSIGNED__ 1
+#define __UINT32_MAX__ 4294967295UL
+#define __ULFRACT_MAX__ 0XFFFFFFFFP-32ULR
+#define __TA_IBIT__ 64
+#define __LDBL_MAX_EXP__ 1024
+#define __WINT_MIN__ 0U
+#define __ULLFRACT_MIN__ 0.0ULLR
+#define __SCHAR_MAX__ 127
+#define __WCHAR_MIN__ 0U
+#define __INT64_C(c) c ## LL
+#define __DBL_DIG__ 15
+#define __GCC_ATOMIC_POINTER_LOCK_FREE 1
+#define __LLACCUM_MIN__ (-0X1P31LLK-0X1P31LLK)
+#define __SIZEOF_INT__ 4
+#define __SIZEOF_POINTER__ 4
+#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 1
+#define __USACCUM_IBIT__ 8
+#define __USER_LABEL_PREFIX__
+#define __STDC_HOSTED__ 1
+#define __LDBL_HAS_INFINITY__ 1
+#define __LFRACT_MIN__ (-0.5LR-0.5LR)
+#define __HA_IBIT__ 8
+#define __TQ_IBIT__ 0
+#define __FLT_EPSILON__ 1.1920928955078125e-7F
+#define __APCS_32__ 1
+#define __GXX_WEAK__ 1
+#define __USFRACT_IBIT__ 0
+#define __LDBL_MIN__ 2.2250738585072014e-308L
+#define __FRACT_MIN__ (-0.5R-0.5R)
+#define __DEC32_MAX__ 9.999999E96DF
+#define __DA_IBIT__ 32
+#define __INT32_MAX__ 2147483647L
+#define __UQQ_FBIT__ 8
+#define __SIZEOF_LONG__ 4
+#define __UACCUM_MAX__ 0XFFFFFFFFP-16UK
+#define __UINT16_C(c) c
+#define __DECIMAL_DIG__ 17
+#define __LFRACT_EPSILON__ 0x1P-31LR
+#define __ULFRACT_MIN__ 0.0ULR
+#define __LDBL_HAS_QUIET_NAN__ 1
+#define __ULACCUM_IBIT__ 32
+#define __UACCUM_EPSILON__ 0x1P-16UK
+#define __GNUC__ 4
+#define __ULLACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULLK
+#define __HQ_IBIT__ 0
+#define __FLT_HAS_DENORM__ 1
+#define __SIZEOF_LONG_DOUBLE__ 8
+#define __BIGGEST_ALIGNMENT__ 8
+#define __DQ_IBIT__ 0
+#define __DBL_MAX__ double(1.7976931348623157e+308L)
+#define __ULFRACT_IBIT__ 0
+#define __INT_FAST32_MAX__ 2147483647
+#define __DBL_HAS_INFINITY__ 1
+#define __INT64_MAX__ 9223372036854775807LL
+#define __ACCUM_IBIT__ 16
+#define __DEC32_MIN_EXP__ (-94)
+#define __THUMB_INTERWORK__ 1
+#define __LACCUM_MAX__ 0X7FFFFFFFFFFFFFFFP-31LK
+#define __INT_FAST16_TYPE__ int
+#define __LDBL_HAS_DENORM__ 1
+#define __cplusplus 199711L
+#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL
+#define __INT_LEAST32_MAX__ 2147483647L
+#define __ARM_PCS 1
+#define __DEC32_MIN__ 1E-95DF
+#define __ACCUM_MAX__ 0X7FFFFFFFP-15K
+#define __DEPRECATED 1
+#define __DBL_MAX_EXP__ 1024
+#define __USACCUM_EPSILON__ 0x1P-8UHK
+#define __DEC128_EPSILON__ 1E-33DL
+#define __SFRACT_MAX__ 0X7FP-7HR
+#define __FRACT_IBIT__ 0
+#define __PTRDIFF_MAX__ 2147483647
+#define __UACCUM_MIN__ 0.0UK
+#define __UACCUM_IBIT__ 16
+#define __GNUG__ 4
+#define __LONG_LONG_MAX__ 9223372036854775807LL
+#define __SIZEOF_SIZE_T__ 4
+#define __ULACCUM_MAX__ 0XFFFFFFFFFFFFFFFFP-32ULK
+#define __SIZEOF_WINT_T__ 4
+#define __SA_IBIT__ 16
+#define __ULLACCUM_MIN__ 0.0ULLK
+#define __GXX_ABI_VERSION 1002
+#define __UTA_FBIT__ 64
+#define __SOFTFP__ 1
+#define __FLT_MIN_EXP__ (-125)
+#define __USFRACT_MAX__ 0XFFP-8UHR
+#define __UFRACT_IBIT__ 0
+#define __INT_FAST64_TYPE__ long long int
+#define __DBL_MIN__ double(2.2250738585072014e-308L)
+#define __FLT_MIN_10_EXP__ (-37)
+#define __LACCUM_MIN__ (-0X1P31LK-0X1P31LK)
+#define __ULLACCUM_FBIT__ 32
+#define __GXX_TYPEINFO_EQUALITY_INLINE 0
+#define __ULLFRACT_EPSILON__ 0x1P-64ULLR
+#define __USES_INITFINI__ 1
+#define __DEC128_MIN__ 1E-6143DL
+#define __REGISTER_PREFIX__
+#define __UINT16_MAX__ 65535
+#define __DBL_HAS_DENORM__ 1
+#define __ACCUM_MIN__ (-0X1P15K-0X1P15K)
+#define __SQ_IBIT__ 0
+#define __UINT8_TYPE__ unsigned char
+#define __UHA_FBIT__ 8
+#define __NO_INLINE__ 1
+#define __SFRACT_MIN__ (-0.5HR-0.5HR)
+#define __UTQ_FBIT__ 128
+#define __FLT_MANT_DIG__ 24
+#define __VERSION__ "4.7.4 20130913 (release) [ARM/embedded-4_7-branch revision 202601]"
+#define __UINT64_C(c) c ## ULL
+#define __ULLFRACT_FBIT__ 64
+#define __FRACT_EPSILON__ 0x1P-15R
+#define __ULACCUM_MIN__ 0.0ULK
+#define __UDA_FBIT__ 32
+#define __LLACCUM_EPSILON__ 0x1P-31LLK
+#define __GCC_ATOMIC_INT_LOCK_FREE 1
+#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __USFRACT_MIN__ 0.0UHR
+#define __ULLACCUM_IBIT__ 32
+#define __UQQ_IBIT__ 0
+#define __INT32_C(c) c ## L
+#define __DEC64_EPSILON__ 1E-15DD
+#define __ORDER_PDP_ENDIAN__ 3412
+#define __DEC128_MIN_EXP__ (-6142)
+#define __UHQ_FBIT__ 16
+#define __LLACCUM_FBIT__ 31
+#define __INT_FAST32_TYPE__ int
+#define __UINT_LEAST16_TYPE__ short unsigned int
+#define __INT16_MAX__ 32767
+#define __SIZE_TYPE__ unsigned int
+#define __UINT64_MAX__ 18446744073709551615ULL
+#define __UDQ_FBIT__ 64
+#define __INT8_TYPE__ signed char
+#define __ELF__ 1
+#define __ULFRACT_EPSILON__ 0x1P-32ULR
+#define __LLFRACT_FBIT__ 63
+#define __FLT_RADIX__ 2
+#define __INT_LEAST16_TYPE__ short int
+#define __LDBL_EPSILON__ 2.2204460492503131e-16L
+#define __UINTMAX_C(c) c ## ULL
+#define __SACCUM_MAX__ 0X7FFFP-7HK
+#define __SIG_ATOMIC_MAX__ 2147483647
+#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 1
+#define __VFP_FP__ 1
+#define __SIZEOF_PTRDIFF_T__ 4
+#define __LACCUM_EPSILON__ 0x1P-31LK
+#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF
+#define __INT_FAST16_MAX__ 2147483647
+#define __UINT_FAST32_MAX__ 4294967295U
+#define __UINT_LEAST64_TYPE__ long long unsigned int
+#define __USACCUM_MAX__ 0XFFFFP-8UHK
+#define __SFRACT_EPSILON__ 0x1P-7HR
+#define __FLT_HAS_QUIET_NAN__ 1
+#define __FLT_MAX_10_EXP__ 38
+#define __LONG_MAX__ 2147483647L
+#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL
+#define __FLT_HAS_INFINITY__ 1
+#define __USA_FBIT__ 16
+#define __UINT_FAST16_TYPE__ unsigned int
+#define __DEC64_MAX__ 9.999999999999999E384DD
+#define __CHAR16_TYPE__ short unsigned int
+#define __PRAGMA_REDEFINE_EXTNAME 1
+#define __INT_LEAST16_MAX__ 32767
+#define __DEC64_MANT_DIG__ 16
+#define __UINT_LEAST32_MAX__ 4294967295UL
+#define __SACCUM_FBIT__ 7
+#define __GCC_ATOMIC_LONG_LOCK_FREE 1
+#define __INT_LEAST64_TYPE__ long long int
+#define __INT16_TYPE__ short int
+#define __INT_LEAST8_TYPE__ signed char
+#define __SQ_FBIT__ 31
+#define __DEC32_MAX_EXP__ 97
+#define __INT_FAST8_MAX__ 2147483647
+#define __INTPTR_MAX__ 2147483647
+#define __QQ_FBIT__ 7
+#define __UTA_IBIT__ 64
+#define __EXCEPTIONS 1
+#define __LDBL_MANT_DIG__ 53
+#define __SFRACT_FBIT__ 7
+#define __SACCUM_MIN__ (-0X1P7HK-0X1P7HK)
+#define __DBL_HAS_QUIET_NAN__ 1
+#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1)
+#define __INTPTR_TYPE__ int
+#define __UINT16_TYPE__ short unsigned int
+#define __WCHAR_TYPE__ unsigned int
+#define __SIZEOF_FLOAT__ 4
+#define __USQ_FBIT__ 32
+#define __UINTPTR_MAX__ 4294967295U
+#define __DEC64_MIN_EXP__ (-382)
+#define __INT_FAST64_MAX__ 9223372036854775807LL
+#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1
+#define __FLT_DIG__ 6
+#define __UINT_FAST64_TYPE__ long long unsigned int
+#define __INT_MAX__ 2147483647
+#define __LACCUM_FBIT__ 31
+#define __USACCUM_MIN__ 0.0UHK
+#define __UHA_IBIT__ 8
+#define __INT64_TYPE__ long long int
+#define __FLT_MAX_EXP__ 128
+#define __UTQ_IBIT__ 0
+#define __DBL_MANT_DIG__ 53
+#define __INT_LEAST64_MAX__ 9223372036854775807LL
+#define __DEC64_MIN__ 1E-383DD
+#define __WINT_TYPE__ unsigned int
+#define __UINT_LEAST32_TYPE__ long unsigned int
+#define __SIZEOF_SHORT__ 2
+#define __ULLFRACT_IBIT__ 0
+#define __LDBL_MIN_EXP__ (-1021)
+#define __arm__ 1
+#define __UDA_IBIT__ 32
+#define __INT_LEAST8_MAX__ 127
+#define __LFRACT_FBIT__ 31
+#define __WCHAR_UNSIGNED__ 1
+#define __LDBL_MAX_10_EXP__ 308
+#define __ATOMIC_RELAXED 0
+#define __DBL_EPSILON__ double(2.2204460492503131e-16L)
+#define __UINT8_C(c) c
+#define __INT_LEAST32_TYPE__ long int
+#define __SIZEOF_WCHAR_T__ 4
+#define __UINT64_TYPE__ long long unsigned int
+#define __LLFRACT_MAX__ 0X7FFFFFFFFFFFFFFFP-63LLR
+#define __TQ_FBIT__ 127
+#define __INT_FAST8_TYPE__ int
+#define __ULLACCUM_EPSILON__ 0x1P-32ULLK
+#define __UHQ_IBIT__ 0
+#define __LLACCUM_IBIT__ 32
+#define __DBL_DECIMAL_DIG__ 17
+#define __DEC_EVAL_METHOD__ 2
+#define __TA_FBIT__ 63
+#define __UDQ_IBIT__ 0
+#define __ORDER_BIG_ENDIAN__ 4321
+#define __ACCUM_EPSILON__ 0x1P-15K
+#define __UINT32_C(c) c ## UL
+#define __INTMAX_MAX__ 9223372036854775807LL
+#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
+#define __FLT_DENORM_MIN__ 1.4012984643248171e-45F
+#define __LLFRACT_IBIT__ 0
+#define __INT8_MAX__ 127
+#define __UINT_FAST32_TYPE__ unsigned int
+#define __CHAR32_TYPE__ long unsigned int
+#define __FLT_MAX__ 3.4028234663852886e+38F
+#define __USACCUM_FBIT__ 8
+#define __INT32_TYPE__ long int
+#define __SIZEOF_DOUBLE__ 8
+#define __UFRACT_EPSILON__ 0x1P-16UR
+#define __INTMAX_TYPE__ long long int
+#define __DEC128_MAX_EXP__ 6145
+#define __ATOMIC_CONSUME 1
+#define __GNUC_MINOR__ 7
+#define __UINTMAX_MAX__ 18446744073709551615ULL
+#define __DEC32_MANT_DIG__ 7
+#define __HA_FBIT__ 7
+#define __DBL_MAX_10_EXP__ 308
+#define __LDBL_DENORM_MIN__ 4.9406564584124654e-324L
+#define __INT16_C(c) c
+#define __STDC__ 1
+#define __ARM_ARCH_4T__ 1
+#define __PTRDIFF_TYPE__ int
+#define __LLFRACT_MIN__ (-0.5LLR-0.5LLR)
+#define __ATOMIC_SEQ_CST 5
+#define __DA_FBIT__ 31
+#define __UINT32_TYPE__ long unsigned int
+#define __UINTPTR_TYPE__ unsigned int
+#define __USA_IBIT__ 16
+#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD
+#define __ARM_EABI__ 1
+#define __DEC128_MANT_DIG__ 34
+#define __LDBL_MIN_10_EXP__ (-307)
+#define __SIZEOF_LONG_LONG__ 8
+#define __ULACCUM_EPSILON__ 0x1P-32ULK
+#define __SACCUM_IBIT__ 8
+#define __GCC_ATOMIC_LLONG_LOCK_FREE 1
+#define __LDBL_DIG__ 15
+#define __FLT_DECIMAL_DIG__ 9
+#define __UINT_FAST16_MAX__ 4294967295U
+#define __GNUC_GNU_INLINE__ 1
+#define __GCC_ATOMIC_SHORT_LOCK_FREE 1
+#define __ULLFRACT_MAX__ 0XFFFFFFFFFFFFFFFFP-64ULLR
+#define __UINT_FAST8_TYPE__ unsigned int
+#define __USFRACT_EPSILON__ 0x1P-8UHR
+#define __ULACCUM_FBIT__ 32
+#define __QQ_IBIT__ 0
+#define __ATOMIC_ACQ_REL 4
+#define __ATOMIC_RELEASE 3
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/size-options.lnt b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/size-options.lnt
new file mode 100644
index 000000000..8f632b6b8
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/size-options.lnt
@@ -0,0 +1 @@
+-ss2 -si4 -sl4 -sll8 -sf4 -sd8 -sld8 -sp4 -sw2 \ No newline at end of file
diff --git a/demos/STM32/RT-STM32F407-DISCOVERY/pclint/waivers.lnt b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/waivers.lnt
new file mode 100644
index 000000000..fa5e71a23
--- /dev/null
+++ b/demos/STM32/RT-STM32F407-DISCOVERY/pclint/waivers.lnt
@@ -0,0 +1,42 @@
+/* MISRA checks are not performed in header files marked as libraries or
+ vendor-provided files or belonging to other subsystems.*/
+-elib(*)
++libclass(angle,ansi)
++libh(core_cm4.h)
++libh(stm32f4xx.h)
++libh(*LLD.h)
+
+/* Removing *advisory* directives and rules that would negatively impact
+ code clarity or are very common.*/
+-e970 /* Dir-4.6 */
+-e9026 /* Dir-4.9 */
+-e818 /* Rule 8.13 */
+-e9078 /* Rule-11.4 */
+-e9079 /* Rule-11.5 */
+-e904 /* Rule-15.5 */
+-e9044 /* Rule-17.8 */
+-e9024 /* Rule-20.10 */
+
+/* Waiver Directive 4.10, PCLint is confused by the guard used in the CMSIS
+ header files, the guard is present, suppressing the noise.*/
+-e451
+
+/* Waiver Rule 3.1, the sequence "//" is mandated by standard license
+ headers included on top of all source files. The sequence is part of the
+ license URL and cannot be removed.*/
+-e9059
+
+/* Waiver Rule 11.6, cast from integer to pointer is very commonly used
+ when accessing peripherals where the numeric address of the registers
+ block is cast to a structure pointer.*/
+-e923
+
+/* Waiver Rule 16.3, missing break into case. It is a common occurrence and
+ thoroughly checked.*/
+-e9090
+-e616
+-e825
+
+/* Waiver Rule 21.1, this is an operating system, its identifiers are
+ equivalent in importance to compiler symbols.*/
+-e9071
diff --git a/os/common/ports/ARMCMx/devices/STM32F3xx/cmparams.h b/os/common/ports/ARMCMx/devices/STM32F3xx/cmparams.h
index 04e400949..12f2b31f4 100644
--- a/os/common/ports/ARMCMx/devices/STM32F3xx/cmparams.h
+++ b/os/common/ports/ARMCMx/devices/STM32F3xx/cmparams.h
@@ -74,7 +74,7 @@
assembler source files. We verify that the info matches instead.*/
#include "stm32f3xx.h"
-#if !CORTEX_HAS_FPU != !__FPU_PRESENT
+#if CORTEX_HAS_FPU != __FPU_PRESENT
#error "CMSIS __FPU_PRESENT mismatch"
#endif
diff --git a/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h b/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h
index 3104d0d6c..0f8b090b7 100644
--- a/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h
+++ b/os/common/ports/ARMCMx/devices/STM32F4xx/cmparams.h
@@ -74,7 +74,7 @@
assembler source files. We verify that the info matches instead.*/
#include "stm32f4xx.h"
-#if !CORTEX_HAS_FPU != !__FPU_PRESENT
+#if CORTEX_HAS_FPU != __FPU_PRESENT
#error "CMSIS __FPU_PRESENT mismatch"
#endif
diff --git a/os/rt/include/chbsem.h b/os/rt/include/chbsem.h
index ca79665ba..96d1ca2fb 100644
--- a/os/rt/include/chbsem.h
+++ b/os/rt/include/chbsem.h
@@ -49,7 +49,7 @@
#ifndef _CHBSEM_H_
#define _CHBSEM_H_
-#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -123,7 +123,7 @@ typedef struct {
*/
static inline void chBSemObjectInit(binary_semaphore_t *bsp, bool taken) {
- chSemObjectInit(&bsp->bs_sem, taken ? 0 : 1);
+ chSemObjectInit(&bsp->bs_sem, taken ? (cnt_t)0 : (cnt_t)1);
}
/**
@@ -233,7 +233,7 @@ static inline void chBSemResetI(binary_semaphore_t *bsp, bool taken) {
chDbgCheckClassI();
- chSemResetI(&bsp->bs_sem, taken ? 0 : 1);
+ chSemResetI(&bsp->bs_sem, taken ? (cnt_t)0 : (cnt_t)1);
}
/**
@@ -252,7 +252,7 @@ static inline void chBSemResetI(binary_semaphore_t *bsp, bool taken) {
*/
static inline void chBSemReset(binary_semaphore_t *bsp, bool taken) {
- chSemReset(&bsp->bs_sem, taken ? 0 : 1);
+ chSemReset(&bsp->bs_sem, taken ? (cnt_t)0 : (cnt_t)1);
}
/**
@@ -301,10 +301,10 @@ static inline bool chBSemGetStateI(binary_semaphore_t *bsp) {
chDbgCheckClassI();
- return bsp->bs_sem.s_cnt > 0 ? false : true;
+ return (bsp->bs_sem.s_cnt > 0) ? false : true;
}
-#endif /* CH_CFG_USE_SEMAPHORES */
+#endif /* CH_CFG_USE_SEMAPHORES == TRUE */
#endif /* _CHBSEM_H_ */
diff --git a/os/rt/include/chcond.h b/os/rt/include/chcond.h
index e8759b8f8..e8620e9c5 100644
--- a/os/rt/include/chcond.h
+++ b/os/rt/include/chcond.h
@@ -31,7 +31,7 @@
#ifndef _CHCOND_H_
#define _CHCOND_H_
-#if CH_CFG_USE_CONDVARS || defined(__DOXYGEN__)
+#if (CH_CFG_USE_CONDVARS == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -45,7 +45,7 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if !CH_CFG_USE_MUTEXES
+#if CH_CFG_USE_MUTEXES == FALSE
#error "CH_CFG_USE_CONDVARS requires CH_CFG_USE_MUTEXES"
#endif
@@ -97,7 +97,7 @@ extern "C" {
void chCondBroadcastI(condition_variable_t *cp);
msg_t chCondWait(condition_variable_t *cp);
msg_t chCondWaitS(condition_variable_t *cp);
-#if CH_CFG_USE_CONDVARS_TIMEOUT
+#if CH_CFG_USE_CONDVARS_TIMEOUT == TRUE
msg_t chCondWaitTimeout(condition_variable_t *cp, systime_t time);
msg_t chCondWaitTimeoutS(condition_variable_t *cp, systime_t time);
#endif
@@ -109,7 +109,7 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
-#endif /* CH_CFG_USE_CONDVARS */
+#endif /* CH_CFG_USE_CONDVARS == TRUE */
#endif /* _CHCOND_H_ */
diff --git a/os/rt/include/chdebug.h b/os/rt/include/chdebug.h
index 728d9bf35..2e4b846f3 100644
--- a/os/rt/include/chdebug.h
+++ b/os/rt/include/chdebug.h
@@ -74,7 +74,7 @@
/* Module data structures and types. */
/*===========================================================================*/
-#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_TRACE == TRUE) || defined(__DOXYGEN__)
/**
* @brief Trace buffer record.
*/
@@ -120,14 +120,14 @@ typedef struct {
/* Module macros. */
/*===========================================================================*/
-#if CH_DBG_SYSTEM_STATE_CHECK
+#if CH_DBG_SYSTEM_STATE_CHECK == TRUE
#define _dbg_enter_lock() (ch.dbg.lock_cnt = 1)
#define _dbg_leave_lock() (ch.dbg.lock_cnt = 0)
#endif
/* When the state checker feature is disabled then the following functions
are replaced by an empty macro.*/
-#if !CH_DBG_SYSTEM_STATE_CHECK
+#if CH_DBG_SYSTEM_STATE_CHECK == FALSE
#define _dbg_enter_lock()
#define _dbg_leave_lock()
#define _dbg_check_disable()
@@ -145,7 +145,7 @@ typedef struct {
/* When the trace feature is disabled this function is replaced by an empty
macro.*/
-#if !CH_DBG_ENABLE_TRACE
+#if CH_DBG_ENABLE_TRACE == FALSE
#define _dbg_trace(otp)
#endif
@@ -164,11 +164,15 @@ typedef struct {
* @api
*/
#if !defined(chDbgCheck)
+#if CH_DBG_ENABLE_CHECKS
#define chDbgCheck(c) do { \
- if (CH_DBG_ENABLE_CHECKS && !(c)) { \
+ if (!(c)) { \
chSysHalt(__func__); \
} \
-} while (0)
+} while (false)
+#else
+#define chDbgCheck(c)
+#endif
#endif /* !defined(chDbgCheck) */
/**
@@ -186,11 +190,15 @@ typedef struct {
* @api
*/
#if !defined(chDbgAssert)
+#if CH_DBG_ENABLE_ASSERTS == TRUE
#define chDbgAssert(c, r) do { \
- if (CH_DBG_ENABLE_ASSERTS && !(c)) { \
+ if (!(c)) { \
chSysHalt(__func__); \
} \
-} while (0)
+} while (false)
+#else
+#define chDbgAssert(c, r)
+#endif
#endif /* !defined(chDbgAssert) */
/** @} */
@@ -201,7 +209,7 @@ typedef struct {
#ifdef __cplusplus
extern "C" {
#endif
-#if CH_DBG_SYSTEM_STATE_CHECK
+#if CH_DBG_SYSTEM_STATE_CHECK == TRUE
void _dbg_check_disable(void);
void _dbg_check_suspend(void);
void _dbg_check_enable(void);
@@ -214,7 +222,7 @@ extern "C" {
void chDbgCheckClassI(void);
void chDbgCheckClassS(void);
#endif
-#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_TRACE == TRUE) || defined(__DOXYGEN__)
void _dbg_trace_init(void);
void _dbg_trace(thread_t *otp);
#endif
diff --git a/os/rt/include/chdynamic.h b/os/rt/include/chdynamic.h
index 7a2e0c581..66f3232c0 100644
--- a/os/rt/include/chdynamic.h
+++ b/os/rt/include/chdynamic.h
@@ -28,7 +28,7 @@
#ifndef _CHDYNAMIC_H_
#define _CHDYNAMIC_H_
-#if CH_CFG_USE_DYNAMIC || defined(__DOXYGEN__)
+#if (CH_CFG_USE_DYNAMIC == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -45,11 +45,11 @@
/*
* Module dependencies check.
*/
-#if CH_CFG_USE_DYNAMIC && !CH_CFG_USE_WAITEXIT
+#if CH_CFG_USE_WAITEXIT == FALSE
#error "CH_CFG_USE_DYNAMIC requires CH_CFG_USE_WAITEXIT"
#endif
-#if CH_CFG_USE_DYNAMIC && !CH_CFG_USE_HEAP && !CH_CFG_USE_MEMPOOLS
+#if (CH_CFG_USE_HEAP == FALSE) && (CH_CFG_USE_MEMPOOLS == FALSE)
#error "CH_CFG_USE_DYNAMIC requires CH_CFG_USE_HEAP and/or CH_CFG_USE_MEMPOOLS"
#endif
@@ -73,11 +73,11 @@ extern "C" {
#endif
thread_t *chThdAddRef(thread_t *tp);
void chThdRelease(thread_t *tp);
-#if CH_CFG_USE_HEAP
+#if CH_CFG_USE_HEAP == TRUE
thread_t *chThdCreateFromHeap(memory_heap_t *heapp, size_t size,
tprio_t prio, tfunc_t pf, void *arg);
#endif
-#if CH_CFG_USE_MEMPOOLS
+#if CH_CFG_USE_MEMPOOLS == TRUE
thread_t *chThdCreateFromMemoryPool(memory_pool_t *mp, tprio_t prio,
tfunc_t pf, void *arg);
#endif
@@ -89,7 +89,7 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
-#endif /* CH_CFG_USE_DYNAMIC */
+#endif /* CH_CFG_USE_DYNAMIC == TRUE */
#endif /* _CHDYNAMIC_H_ */
diff --git a/os/rt/include/chevents.h b/os/rt/include/chevents.h
index e7c91d669..9e06f897c 100644
--- a/os/rt/include/chevents.h
+++ b/os/rt/include/chevents.h
@@ -31,7 +31,7 @@
#ifndef _CHEVENTS_H_
#define _CHEVENTS_H_
-#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
+#if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -80,7 +80,7 @@ typedef struct event_source {
/**
* @brief Event Handler callback function.
*/
-typedef void (*evhandler_t)(eventid_t);
+typedef void (*evhandler_t)(eventid_t id);
/*===========================================================================*/
/* Module macros. */
@@ -94,7 +94,7 @@ typedef void (*evhandler_t)(eventid_t);
/**
* @brief Returns an event mask from an event identifier.
*/
-#define EVENT_MASK(eid) ((eventmask_t)(1 << (eid)))
+#define EVENT_MASK(eid) ((eventmask_t)1 << (eventmask_t)(eid))
/**
* @brief Data part of a static event source initializer.
@@ -134,12 +134,12 @@ extern "C" {
void chEvtBroadcastFlags(event_source_t *esp, eventflags_t flags);
void chEvtBroadcastFlagsI(event_source_t *esp, eventflags_t flags);
void chEvtDispatch(const evhandler_t *handlers, eventmask_t events);
-#if CH_CFG_OPTIMIZE_SPEED || !CH_CFG_USE_EVENTS_TIMEOUT
+#if (CH_CFG_OPTIMIZE_SPEED == TRUE) || (CH_CFG_USE_EVENTS_TIMEOUT == FALSE)
eventmask_t chEvtWaitOne(eventmask_t events);
eventmask_t chEvtWaitAny(eventmask_t events);
eventmask_t chEvtWaitAll(eventmask_t events);
#endif
-#if CH_CFG_USE_EVENTS_TIMEOUT
+#if CH_CFG_USE_EVENTS_TIMEOUT == TRUE
eventmask_t chEvtWaitOneTimeout(eventmask_t events, systime_t time);
eventmask_t chEvtWaitAnyTimeout(eventmask_t events, systime_t time);
eventmask_t chEvtWaitAllTimeout(eventmask_t events, systime_t time);
@@ -148,7 +148,7 @@ extern "C" {
}
#endif
-#if !CH_CFG_OPTIMIZE_SPEED && CH_CFG_USE_EVENTS_TIMEOUT
+#if (CH_CFG_OPTIMIZE_SPEED == FALSE) && (CH_CFG_USE_EVENTS_TIMEOUT == TRUE)
#define chEvtWaitOne(mask) chEvtWaitOneTimeout(mask, TIME_INFINITE)
#define chEvtWaitAny(mask) chEvtWaitAnyTimeout(mask, TIME_INFINITE)
#define chEvtWaitAll(mask) chEvtWaitAllTimeout(mask, TIME_INFINITE)
@@ -169,7 +169,9 @@ extern "C" {
*/
static inline void chEvtObjectInit(event_source_t *esp) {
- esp->es_next = (event_listener_t *)(void *)esp;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ esp->es_next = (event_listener_t *)esp;
+ /*lint -restore*/
}
/**
@@ -223,7 +225,9 @@ static inline void chEvtRegister(event_source_t *esp,
*/
static inline bool chEvtIsListeningI(event_source_t *esp) {
- return (bool)((void *)esp != (void *)esp->es_next);
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ return (bool)(esp != (event_source_t *)esp->es_next);
+ /*lint -restore*/
}
/**
@@ -256,7 +260,7 @@ static inline void chEvtBroadcastI(event_source_t *esp) {
chEvtBroadcastFlagsI(esp, 0);
}
-#endif /* CH_CFG_USE_EVENTS */
+#endif /* CH_CFG_USE_EVENTS == TRUE */
#endif /* _CHEVENTS_H_ */
diff --git a/os/rt/include/chheap.h b/os/rt/include/chheap.h
index e8baae9a7..b041646b5 100644
--- a/os/rt/include/chheap.h
+++ b/os/rt/include/chheap.h
@@ -28,7 +28,7 @@
#ifndef _CHHEAP_H_
#define _CHHEAP_H_
-#if CH_CFG_USE_HEAP || defined(__DOXYGEN__)
+#if (CH_CFG_USE_HEAP == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -42,11 +42,11 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if !CH_CFG_USE_MEMCORE
+#if CH_CFG_USE_MEMCORE == FALSE
#error "CH_CFG_USE_HEAP requires CH_CFG_USE_MEMCORE"
#endif
-#if !CH_CFG_USE_MUTEXES && !CH_CFG_USE_SEMAPHORES
+#if (CH_CFG_USE_MUTEXES == FALSE) && (CH_CFG_USE_SEMAPHORES == FALSE)
#error "CH_CFG_USE_HEAP requires CH_CFG_USE_MUTEXES and/or CH_CFG_USE_SEMAPHORES"
#endif
@@ -80,7 +80,7 @@ struct memory_heap {
memgetfunc_t h_provider; /**< @brief Memory blocks provider for
this heap. */
union heap_header h_free; /**< @brief Free blocks list header. */
-#if CH_CFG_USE_MUTEXES
+#if CH_CFG_USE_MUTEXES == TRUE
mutex_t h_mtx; /**< @brief Heap access mutex. */
#else
semaphore_t h_sem; /**< @brief Heap access semaphore. */
@@ -111,7 +111,7 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
-#endif /* CH_CFG_USE_HEAP */
+#endif /* CH_CFG_USE_HEAP == TRUE */
#endif /* _CHHEAP_H_ */
diff --git a/os/rt/include/chmboxes.h b/os/rt/include/chmboxes.h
index 5a2f964fa..6cf12abb5 100644
--- a/os/rt/include/chmboxes.h
+++ b/os/rt/include/chmboxes.h
@@ -28,7 +28,7 @@
#ifndef _CHMBOXES_H_
#define _CHMBOXES_H_
-#if CH_CFG_USE_MAILBOXES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MAILBOXES == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -42,7 +42,7 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if !CH_CFG_USE_SEMAPHORES
+#if CH_CFG_USE_SEMAPHORES == FALSE
#error "CH_CFG_USE_MAILBOXES requires CH_CFG_USE_SEMAPHORES"
#endif
@@ -137,7 +137,10 @@ extern "C" {
*/
static inline size_t chMBGetSizeI(mailbox_t *mbp) {
+ /*lint -save -e946 -e947 -e9033 [18.2, 18.3, 10.8] Perfectly safe pointers
+ arithmetic.*/
return (size_t)(mbp->mb_top - mbp->mb_buffer);
+ /*lint -restore*/
}
/**
@@ -197,7 +200,7 @@ static inline msg_t chMBPeekI(mailbox_t *mbp) {
return *mbp->mb_rdptr;
}
-#endif /* CH_CFG_USE_MAILBOXES */
+#endif /* CH_CFG_USE_MAILBOXES == TRUE */
#endif /* _CHMBOXES_H_ */
diff --git a/os/rt/include/chmemcore.h b/os/rt/include/chmemcore.h
index fde35415d..33bafe072 100644
--- a/os/rt/include/chmemcore.h
+++ b/os/rt/include/chmemcore.h
@@ -28,7 +28,7 @@
#ifndef _CHMEMCORE_H_
#define _CHMEMCORE_H_
-#if CH_CFG_USE_MEMCORE || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MEMCORE == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -68,7 +68,7 @@ typedef void *(*memgetfunc_t)(size_t size);
/**
* @brief Alignment mask constant.
*/
-#define MEM_ALIGN_MASK (MEM_ALIGN_SIZE - 1)
+#define MEM_ALIGN_MASK (MEM_ALIGN_SIZE - 1U)
/**
* @brief Alignment helper macro.
@@ -84,7 +84,7 @@ typedef void *(*memgetfunc_t)(size_t size);
* @brief Returns whatever a pointer or memory size is aligned to
* the type @p align_t.
*/
-#define MEM_IS_ALIGNED(p) (((size_t)(p) & MEM_ALIGN_MASK) == 0)
+#define MEM_IS_ALIGNED(p) (((size_t)(p) & MEM_ALIGN_MASK) == 0U)
/** @} */
/*===========================================================================*/
@@ -106,7 +106,7 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
-#endif /* CH_CFG_USE_MEMCORE */
+#endif /* CH_CFG_USE_MEMCORE == TRUE */
#endif /* _CHMEMCORE_H_ */
diff --git a/os/rt/include/chmempools.h b/os/rt/include/chmempools.h
index e1ee0d1a5..3e363f86d 100644
--- a/os/rt/include/chmempools.h
+++ b/os/rt/include/chmempools.h
@@ -28,7 +28,7 @@
#ifndef _CHMEMPOOLS_H_
#define _CHMEMPOOLS_H_
-#if CH_CFG_USE_MEMPOOLS || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MEMPOOLS == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -42,7 +42,7 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if !CH_CFG_USE_MEMCORE
+#if CH_CFG_USE_MEMCORE == FALSE
#error "CH_CFG_USE_MEMPOOLS requires CH_CFG_USE_MEMCORE"
#endif
@@ -161,7 +161,7 @@ static inline void chPoolAddI(memory_pool_t *mp, void *objp) {
chPoolFreeI(mp, objp);
}
-#endif /* CH_CFG_USE_MEMPOOLS */
+#endif /* CH_CFG_USE_MEMPOOLS == TRUE */
#endif /* _CHMEMPOOLS_H_ */
diff --git a/os/rt/include/chmsg.h b/os/rt/include/chmsg.h
index f8b2db17d..0420562c3 100644
--- a/os/rt/include/chmsg.h
+++ b/os/rt/include/chmsg.h
@@ -28,7 +28,7 @@
#ifndef _CHMSG_H_
#define _CHMSG_H_
-#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MESSAGES == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -80,7 +80,9 @@ static inline bool chMsgIsPendingI(thread_t *tp) {
chDbgCheckClassI();
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
return (bool)(tp->p_msgqueue.p_next != (thread_t *)&tp->p_msgqueue);
+ /*lint -restore*/
}
/**
@@ -115,7 +117,7 @@ static inline void chMsgReleaseS(thread_t *tp, msg_t msg) {
chSchWakeupS(tp, msg);
}
-#endif /* CH_CFG_USE_MESSAGES */
+#endif /* CH_CFG_USE_MESSAGES == TRUE */
#endif /* _CHMSG_H_ */
diff --git a/os/rt/include/chmtx.h b/os/rt/include/chmtx.h
index 60e05e851..4a4b643ff 100644
--- a/os/rt/include/chmtx.h
+++ b/os/rt/include/chmtx.h
@@ -28,7 +28,7 @@
#ifndef _CHMTX_H_
#define _CHMTX_H_
-#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -61,7 +61,7 @@ struct mutex {
@p NULL. */
mutex_t *m_next; /**< @brief Next @p mutex_t into an
owner-list or @p NULL. */
-#if CH_CFG_USE_MUTEXES_RECURSIVE || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MUTEXES_RECURSIVE == TRUE) || defined(__DOXYGEN__)
cnt_t m_cnt; /**< @brief Mutex recursion counter. */
#endif
};
@@ -77,7 +77,7 @@ struct mutex {
*
* @param[in] name the name of the mutex variable
*/
-#if CH_CFG_USE_MUTEXES_RECURSIVE || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MUTEXES_RECURSIVE == TRUE) || defined(__DOXYGEN__)
#define _MUTEX_DATA(name) {_THREADS_QUEUE_DATA(name.m_queue), NULL, NULL, 0}
#else
#define _MUTEX_DATA(name) {_THREADS_QUEUE_DATA(name.m_queue), NULL, NULL}
@@ -146,7 +146,7 @@ static inline mutex_t *chMtxGetNextMutexS(void) {
return chThdGetSelfX()->p_mtxlist;
}
-#endif /* CH_CFG_USE_MUTEXES */
+#endif /* CH_CFG_USE_MUTEXES == TRUE */
#endif /* _CHMTX_H_ */
diff --git a/os/rt/include/chqueues.h b/os/rt/include/chqueues.h
index fbebc81e7..ea93708f4 100644
--- a/os/rt/include/chqueues.h
+++ b/os/rt/include/chqueues.h
@@ -28,7 +28,7 @@
#ifndef _CHQUEUES_H_
#define _CHQUEUES_H_
-#if CH_CFG_USE_QUEUES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_QUEUES == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -198,9 +198,9 @@ typedef io_queue_t output_queue_t;
* @param[in] qp pointer to a @p io_queue_t structure.
* @return The buffer size.
*
- * @iclass
+ * @notapi
*/
-#define chQSizeI(qp) ((size_t)((qp)->q_top - (qp)->q_buffer))
+#define QSIZE(qp) ((size_t)((qp)->q_top - (qp)->q_buffer))
/**
* @brief Queue space.
@@ -284,7 +284,10 @@ static inline size_t chIQGetEmptyI(input_queue_t *iqp) {
chDbgCheckClassI();
- return (size_t)(chQSizeI(iqp) - chQSpaceI(iqp));
+ /*lint -save -e946 -e947 -e9033 [18.2, 18.3, 10.8] Perfectly safe pointers
+ arithmetic in QSIZE().*/
+ return (size_t)(QSIZE(iqp) - chQSpaceI(iqp));
+ /*lint -restore*/
}
/**
@@ -301,7 +304,7 @@ static inline bool chIQIsEmptyI(input_queue_t *iqp) {
chDbgCheckClassI();
- return (bool)(chQSpaceI(iqp) <= 0);
+ return (bool)(chQSpaceI(iqp) <= 0U);
}
/**
@@ -318,7 +321,7 @@ static inline bool chIQIsFullI(input_queue_t *iqp) {
chDbgCheckClassI();
- return (bool)((iqp->q_wrptr == iqp->q_rdptr) && (iqp->q_counter != 0));
+ return (bool)((iqp->q_wrptr == iqp->q_rdptr) && (iqp->q_counter != 0U));
}
/**
@@ -351,7 +354,10 @@ static inline size_t chOQGetFullI(output_queue_t *oqp) {
chDbgCheckClassI();
- return (size_t)(chQSizeI(oqp) - chQSpaceI(oqp));
+ /*lint -save -e946 -e947 -e9033 [18.2, 18.3, 10.8] Perfectly safe pointers
+ arithmetic in QSIZE().*/
+ return (size_t)(QSIZE(oqp) - chQSpaceI(oqp));
+ /*lint -restore*/
}
/**
@@ -384,7 +390,7 @@ static inline bool chOQIsEmptyI(output_queue_t *oqp) {
chDbgCheckClassI();
- return (bool)((oqp->q_wrptr == oqp->q_rdptr) && (oqp->q_counter != 0));
+ return (bool)((oqp->q_wrptr == oqp->q_rdptr) && (oqp->q_counter != 0U));
}
/**
@@ -401,7 +407,7 @@ static inline bool chOQIsFullI(output_queue_t *oqp) {
chDbgCheckClassI();
- return (bool)(chQSpaceI(oqp) <= 0);
+ return (bool)(chQSpaceI(oqp) <= 0U);
}
/**
@@ -423,7 +429,7 @@ static inline msg_t chOQPut(output_queue_t *oqp, uint8_t b) {
return chOQPutTimeout(oqp, b, TIME_INFINITE);
}
-#endif /* CH_CFG_USE_QUEUES */
+#endif /* CH_CFG_USE_QUEUES == TRUE */
#endif /* _CHQUEUES_H_ */
diff --git a/os/rt/include/chregistry.h b/os/rt/include/chregistry.h
index b1bcb15b7..002f67d8b 100644
--- a/os/rt/include/chregistry.h
+++ b/os/rt/include/chregistry.h
@@ -28,7 +28,7 @@
#ifndef _CHREGISTRY_H_
#define _CHREGISTRY_H_
-#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
+#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -95,7 +95,7 @@ typedef struct {
#define chRegSetThreadName(p)
#endif /* !CH_CFG_USE_REGISTRY */
-#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
+#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
/**
* @brief Removes a thread from the registry list.
* @note This macro is not meant for use in application code.
@@ -153,7 +153,7 @@ static inline const char *chRegGetThreadNameI(thread_t *tp) {
chDbgCheckClassI();
-#if CH_CFG_USE_REGISTRY
+#if CH_CFG_USE_REGISTRY == TRUE
return tp->p_name;
#else
(void)tp;
@@ -161,7 +161,7 @@ static inline const char *chRegGetThreadNameI(thread_t *tp) {
#endif
}
-#endif /* CH_CFG_USE_REGISTRY */
+#endif /* CH_CFG_USE_REGISTRY == TRUE */
#endif /* _CHREGISTRY_H_ */
diff --git a/os/rt/include/chschd.h b/os/rt/include/chschd.h
index 12a6762fa..c166bc034 100644
--- a/os/rt/include/chschd.h
+++ b/os/rt/include/chschd.h
@@ -36,10 +36,10 @@
* @name Wakeup status codes
* @{
*/
-#define MSG_OK 0 /**< @brief Normal wakeup message. */
-#define MSG_TIMEOUT -1 /**< @brief Wakeup caused by a timeout
+#define MSG_OK 0 /**< @brief Normal wakeup message. */
+#define MSG_TIMEOUT -1 /**< @brief Wakeup caused by a timeout
condition. */
-#define MSG_RESET -2 /**< @brief Wakeup caused by a reset
+#define MSG_RESET -2 /**< @brief Wakeup caused by a reset
condition. */
/** @} */
@@ -47,37 +47,37 @@
* @name Priority constants
* @{
*/
-#define NOPRIO 0 /**< @brief Ready list header priority. */
-#define IDLEPRIO 1 /**< @brief Idle thread priority. */
-#define LOWPRIO 2 /**< @brief Lowest user priority. */
-#define NORMALPRIO 64 /**< @brief Normal user priority. */
-#define HIGHPRIO 127 /**< @brief Highest user priority. */
-#define ABSPRIO 255 /**< @brief Greatest possible priority. */
+#define NOPRIO 0U /**< @brief Ready list header priority. */
+#define IDLEPRIO 1U /**< @brief Idle thread priority. */
+#define LOWPRIO 2U /**< @brief Lowest user priority. */
+#define NORMALPRIO 64U /**< @brief Normal user priority. */
+#define HIGHPRIO 127U /**< @brief Highest user priority. */
+#define ABSPRIO 255U /**< @brief Greatest possible priority. */
/** @} */
/**
* @name Thread states
* @{
*/
-#define CH_STATE_READY 0 /**< @brief Waiting on the ready list. */
-#define CH_STATE_CURRENT 1 /**< @brief Currently running. */
-#define CH_STATE_WTSTART 2 /**< @brief Created but not started. */
-#define CH_STATE_SUSPENDED 3 /**< @brief Suspended state. */
-#define CH_STATE_QUEUED 4 /**< @brief Waiting on an I/O queue. */
-#define CH_STATE_WTSEM 5 /**< @brief Waiting on a semaphore. */
-#define CH_STATE_WTMTX 6 /**< @brief Waiting on a mutex. */
-#define CH_STATE_WTCOND 7 /**< @brief Waiting on a condition
+#define CH_STATE_READY 0U /**< @brief Waiting on the ready list. */
+#define CH_STATE_CURRENT 1U /**< @brief Currently running. */
+#define CH_STATE_WTSTART 2U /**< @brief Created but not started. */
+#define CH_STATE_SUSPENDED 3U /**< @brief Suspended state. */
+#define CH_STATE_QUEUED 4U /**< @brief Waiting on an I/O queue. */
+#define CH_STATE_WTSEM 5U /**< @brief Waiting on a semaphore. */
+#define CH_STATE_WTMTX 6U /**< @brief Waiting on a mutex. */
+#define CH_STATE_WTCOND 7U /**< @brief Waiting on a condition
variable. */
-#define CH_STATE_SLEEPING 8 /**< @brief Waiting in @p chThdSleep()
+#define CH_STATE_SLEEPING 8U /**< @brief Waiting in @p chThdSleep()
or @p chThdSleepUntil(). */
-#define CH_STATE_WTEXIT 9 /**< @brief Waiting in @p chThdWait(). */
-#define CH_STATE_WTOREVT 10 /**< @brief Waiting for an event. */
-#define CH_STATE_WTANDEVT 11 /**< @brief Waiting for several events. */
-#define CH_STATE_SNDMSGQ 12 /**< @brief Sending a message, in queue.*/
-#define CH_STATE_SNDMSG 13 /**< @brief Sent a message, waiting
+#define CH_STATE_WTEXIT 9U /**< @brief Waiting in @p chThdWait(). */
+#define CH_STATE_WTOREVT 10U /**< @brief Waiting for an event. */
+#define CH_STATE_WTANDEVT 11U /**< @brief Waiting for several events. */
+#define CH_STATE_SNDMSGQ 12U /**< @brief Sending a message, in queue.*/
+#define CH_STATE_SNDMSG 13U /**< @brief Sent a message, waiting
answer. */
-#define CH_STATE_WTMSG 14 /**< @brief Waiting for a message. */
-#define CH_STATE_FINAL 15 /**< @brief Thread terminated. */
+#define CH_STATE_WTMSG 14U /**< @brief Waiting for a message. */
+#define CH_STATE_FINAL 15U /**< @brief Thread terminated. */
/**
* @brief Thread states as array of strings.
@@ -94,13 +94,13 @@
* @name Thread flags and attributes
* @{
*/
-#define CH_FLAG_MODE_MASK 3 /**< @brief Thread memory mode mask. */
-#define CH_FLAG_MODE_STATIC 0 /**< @brief Static thread. */
-#define CH_FLAG_MODE_HEAP 1 /**< @brief Thread allocated from a
+#define CH_FLAG_MODE_MASK 3U /**< @brief Thread memory mode mask. */
+#define CH_FLAG_MODE_STATIC 0U /**< @brief Static thread. */
+#define CH_FLAG_MODE_HEAP 1U /**< @brief Thread allocated from a
Memory Heap. */
-#define CH_FLAG_MODE_MEMPOOL 2 /**< @brief Thread allocated from a
+#define CH_FLAG_MODE_MEMPOOL 2U /**< @brief Thread allocated from a
Memory Pool. */
-#define CH_FLAG_TERMINATE 4 /**< @brief Termination requested flag. */
+#define CH_FLAG_TERMINATE 4U /**< @brief Termination requested flag. */
/** @} */
/**
@@ -194,18 +194,18 @@ struct ch_thread {
/* End of the fields shared with the threads_queue_t structure.*/
tprio_t p_prio; /**< @brief Thread priority. */
struct context p_ctx; /**< @brief Processor context. */
-#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
+#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
thread_t *p_newer; /**< @brief Newer registry element. */
thread_t *p_older; /**< @brief Older registry element. */
#endif
/* End of the fields shared with the ReadyList structure. */
-#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
+#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
/**
* @brief Thread name or @p NULL.
*/
const char *p_name;
#endif
-#if CH_DBG_ENABLE_STACK_CHECK || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_STACK_CHECK == TRUE) || defined(__DOXYGEN__)
/**
* @brief Thread stack boundary.
*/
@@ -219,7 +219,7 @@ struct ch_thread {
* @brief Various thread flags.
*/
tmode_t p_flags;
-#if CH_CFG_USE_DYNAMIC || defined(__DOXYGEN__)
+#if (CH_CFG_USE_DYNAMIC == TRUE) || defined(__DOXYGEN__)
/**
* @brief References to this thread.
*/
@@ -231,7 +231,7 @@ struct ch_thread {
#if (CH_CFG_TIME_QUANTUM > 0) || defined(__DOXYGEN__)
tslices_t p_preempt;
#endif
-#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
+#if (CH_DBG_THREADS_PROFILING == TRUE) || defined(__DOXYGEN__)
/**
* @brief Thread consumed time in ticks.
* @note This field can overflow.
@@ -265,7 +265,7 @@ struct ch_thread {
* states.
*/
void *wtobjp;
-#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
+#if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
/**
* @brief Enabled events mask.
* @note This field is only valid while the thread is in the
@@ -274,13 +274,13 @@ struct ch_thread {
eventmask_t ewmask;
#endif
} p_u;
-#if CH_CFG_USE_WAITEXIT || defined(__DOXYGEN__)
+#if (CH_CFG_USE_WAITEXIT == TRUE) || defined(__DOXYGEN__)
/**
* @brief Termination waiting list.
*/
threads_list_t p_waiting;
#endif
-#if CH_CFG_USE_MESSAGES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MESSAGES == TRUE) || defined(__DOXYGEN__)
/**
* @brief Messages queue.
*/
@@ -290,13 +290,13 @@ struct ch_thread {
*/
msg_t p_msg;
#endif
-#if CH_CFG_USE_EVENTS || defined(__DOXYGEN__)
+#if (CH_CFG_USE_EVENTS == TRUE) || defined(__DOXYGEN__)
/**
* @brief Pending events mask.
*/
eventmask_t p_epending;
#endif
-#if CH_CFG_USE_MUTEXES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_MUTEXES == TRUE) || defined(__DOXYGEN__)
/**
* @brief List of the mutexes owned by this thread.
* @note The list is terminated by a @p NULL in this field.
@@ -307,13 +307,14 @@ struct ch_thread {
*/
tprio_t p_realprio;
#endif
-#if (CH_CFG_USE_DYNAMIC && CH_CFG_USE_MEMPOOLS) || defined(__DOXYGEN__)
+#if ((CH_CFG_USE_DYNAMIC == TRUE) && (CH_CFG_USE_MEMPOOLS == TRUE)) || \
+ defined(__DOXYGEN__)
/**
* @brief Memory Pool where the thread workspace is returned.
*/
void *p_mpool;
#endif
-#if CH_DBG_STATISTICS || defined(__DOXYGEN__)
+#if (CH_DBG_STATISTICS == TRUE) || defined(__DOXYGEN__)
/**
* @brief Thread statistics.
*/
@@ -352,10 +353,10 @@ struct ch_virtual_timers_list {
virtual_timer_t *vt_prev; /**< @brief Last timer in the delta
list. */
systime_t vt_delta; /**< @brief Must be initialized to -1. */
-#if CH_CFG_ST_TIMEDELTA == 0 || defined(__DOXYGEN__)
+#if (CH_CFG_ST_TIMEDELTA == 0) || defined(__DOXYGEN__)
volatile systime_t vt_systime; /**< @brief System Time counter. */
#endif
-#if CH_CFG_ST_TIMEDELTA > 0 || defined(__DOXYGEN__)
+#if (CH_CFG_ST_TIMEDELTA > 0) || defined(__DOXYGEN__)
/**
* @brief System time of the last tick event.
*/
@@ -373,7 +374,7 @@ struct ch_ready_list {
initialized to zero. */
struct context r_ctx; /**< @brief Not used, present because
offsets. */
-#if CH_CFG_USE_REGISTRY || defined(__DOXYGEN__)
+#if (CH_CFG_USE_REGISTRY == TRUE) || defined(__DOXYGEN__)
thread_t *r_newer; /**< @brief Newer registry element. */
thread_t *r_older; /**< @brief Older registry element. */
#endif
@@ -394,7 +395,7 @@ struct ch_system_debug {
* field itself is declared volatile.
*/
const char * volatile panic_msg;
-#if CH_DBG_SYSTEM_STATE_CHECK || defined(__DOXYGEN__)
+#if (CH_DBG_SYSTEM_STATE_CHECK == TRUE) || defined(__DOXYGEN__)
/**
* @brief ISR nesting level.
*/
@@ -404,7 +405,7 @@ struct ch_system_debug {
*/
cnt_t lock_cnt;
#endif
-#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_TRACE == TRUE) || defined(__DOXYGEN__)
/**
* @brief Public trace buffer.
*/
@@ -434,19 +435,19 @@ struct ch_system {
* @brief Main thread descriptor.
*/
thread_t mainthread;
-#if CH_CFG_USE_TM || defined(__DOXYGEN__)
+#if (CH_CFG_USE_TM == TRUE) || defined(__DOXYGEN__)
/**
* @brief Time measurement calibration data.
*/
tm_calibration_t tm;
#endif
-#if CH_DBG_STATISTICS || defined(__DOXYGEN__)
+#if (CH_DBG_STATISTICS == TRUE) || defined(__DOXYGEN__)
/**
* @brief Global kernel statistics.
*/
kernel_stats_t kernel_stats;
#endif
-#if !CH_CFG_NO_IDLE_THREAD
+#if CH_CFG_NO_IDLE_THREAD == FALSE
/**
* @brief Idle thread working area.
*/
@@ -501,13 +502,13 @@ extern "C" {
thread_t *chSchReadyI(thread_t *tp);
void chSchGoSleepS(tstate_t newstate);
msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time);
- void chSchWakeupS(thread_t *tp, msg_t msg);
+ void chSchWakeupS(thread_t *ntp, msg_t msg);
void chSchRescheduleS(void);
bool chSchIsPreemptionRequired(void);
void chSchDoRescheduleBehind(void);
void chSchDoRescheduleAhead(void);
void chSchDoReschedule(void);
-#if !CH_CFG_OPTIMIZE_SPEED
+#if CH_CFG_OPTIMIZE_SPEED == FALSE
void queue_prio_insert(thread_t *tp, threads_queue_t *tqp);
void queue_insert(thread_t *tp, threads_queue_t *tqp);
thread_t *queue_fifo_remove(threads_queue_t *tqp);
@@ -515,7 +516,7 @@ extern "C" {
thread_t *queue_dequeue(thread_t *tp);
void list_insert(thread_t *tp, threads_list_t *tlp);
thread_t *list_remove(threads_list_t *tlp);
-#endif /* CH_CFG_OPTIMIZE_SPEED */
+#endif /* CH_CFG_OPTIMIZE_SPEED == FALSE */
#ifdef __cplusplus
}
#endif
@@ -533,7 +534,9 @@ extern "C" {
*/
static inline void list_init(threads_list_t *tlp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
tlp->p_next = (thread_t *)tlp;
+ /*lint -restore*/
}
/**
@@ -546,7 +549,9 @@ static inline void list_init(threads_list_t *tlp) {
*/
static inline bool list_isempty(threads_list_t *tlp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
return (bool)(tlp->p_next == (thread_t *)tlp);
+ /*lint -restore*/
}
/**
@@ -559,7 +564,9 @@ static inline bool list_isempty(threads_list_t *tlp) {
*/
static inline bool list_notempty(threads_list_t *tlp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
return (bool)(tlp->p_next != (thread_t *)tlp);
+ /*lint -restore*/
}
/**
@@ -571,7 +578,10 @@ static inline bool list_notempty(threads_list_t *tlp) {
*/
static inline void queue_init(threads_queue_t *tqp) {
- tqp->p_next = tqp->p_prev = (thread_t *)tqp;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ tqp->p_next = (thread_t *)tqp;
+ tqp->p_prev = (thread_t *)tqp;
+ /*lint -restore*/
}
/**
@@ -584,7 +594,9 @@ static inline void queue_init(threads_queue_t *tqp) {
*/
static inline bool queue_isempty(threads_queue_t *tqp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
return (bool)(tqp->p_next == (thread_t *)tqp);
+ /*lint -restore*/
}
/**
@@ -597,12 +609,14 @@ static inline bool queue_isempty(threads_queue_t *tqp) {
*/
static inline bool queue_notempty(threads_queue_t *tqp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
return (bool)(tqp->p_next != (thread_t *)tqp);
+ /*lint -restore*/
}
/* If the performance code path has been chosen then all the following
functions are inlined into the various kernel modules.*/
-#if CH_CFG_OPTIMIZE_SPEED
+#if CH_CFG_OPTIMIZE_SPEED == TRUE
static inline void list_insert(thread_t *tp, threads_list_t *tlp) {
tp->p_next = tlp->p_next;
@@ -619,26 +633,35 @@ static inline thread_t *list_remove(threads_list_t *tlp) {
static inline void queue_prio_insert(thread_t *tp, threads_queue_t *tqp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
thread_t *cp = (thread_t *)tqp;
do {
cp = cp->p_next;
} while ((cp != (thread_t *)tqp) && (cp->p_prio >= tp->p_prio));
+ /*lint -restore*/
tp->p_next = cp;
tp->p_prev = cp->p_prev;
- tp->p_prev->p_next = cp->p_prev = tp;
+ tp->p_prev->p_next = tp;
+ cp->p_prev = tp;
}
static inline void queue_insert(thread_t *tp, threads_queue_t *tqp) {
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
tp->p_next = (thread_t *)tqp;
+ /*lint -restore*/
tp->p_prev = tqp->p_prev;
- tp->p_prev->p_next = tqp->p_prev = tp;
+ tp->p_prev->p_next = tp;
+ tqp->p_prev = tp;
}
static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->p_next;
- (tqp->p_next = tp->p_next)->p_prev = (thread_t *)tqp;
+ tqp->p_next = tp->p_next;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ tqp->p_next->p_prev = (thread_t *)tqp;
+ /*lint -restore*/
return tp;
}
@@ -646,7 +669,10 @@ static inline thread_t *queue_fifo_remove(threads_queue_t *tqp) {
static inline thread_t *queue_lifo_remove(threads_queue_t *tqp) {
thread_t *tp = tqp->p_prev;
- (tqp->p_prev = tp->p_prev)->p_next = (thread_t *)tqp;
+ tqp->p_prev = tp->p_prev;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ tqp->p_prev->p_next = (thread_t *)tqp;
+ /*lint -restore*/
return tp;
}
@@ -658,7 +684,7 @@ static inline thread_t *queue_dequeue(thread_t *tp) {
return tp;
}
-#endif /* CH_CFG_OPTIMIZE_SPEED */
+#endif /* CH_CFG_OPTIMIZE_SPEED == TRUE */
/**
* @brief Determines if the current thread must reschedule.
diff --git a/os/rt/include/chsem.h b/os/rt/include/chsem.h
index 7d449f65f..51a29e0f2 100644
--- a/os/rt/include/chsem.h
+++ b/os/rt/include/chsem.h
@@ -28,7 +28,7 @@
#ifndef _CHSEM_H_
#define _CHSEM_H_
-#if CH_CFG_USE_SEMAPHORES || defined(__DOXYGEN__)
+#if (CH_CFG_USE_SEMAPHORES == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -153,7 +153,7 @@ static inline cnt_t chSemGetCounterI(semaphore_t *sp) {
return sp->s_cnt;
}
-#endif /* CH_CFG_USE_SEMAPHORES */
+#endif /* CH_CFG_USE_SEMAPHORES == TRUE */
#endif /* _CHSEM_H_ */
diff --git a/os/rt/include/chstats.h b/os/rt/include/chstats.h
index 0c4155662..c2405e444 100644
--- a/os/rt/include/chstats.h
+++ b/os/rt/include/chstats.h
@@ -28,7 +28,7 @@
#ifndef _CHSTATS_H_
#define _CHSTATS_H_
-#if CH_DBG_STATISTICS || defined(__DOXYGEN__)
+#if (CH_DBG_STATISTICS == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -38,7 +38,7 @@
/* Module pre-compile time settings. */
/*===========================================================================*/
-#if !CH_CFG_USE_TM
+#if CH_CFG_USE_TM == FALSE
#error "CH_DBG_STATISTICS requires CH_CFG_USE_TM"
#endif
@@ -88,7 +88,7 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
-#else /* !CH_DBG_STATISTICS */
+#else /* CH_DBG_STATISTICS == FALSE */
/* Stub functions for when the statistics module is disabled. */
#define _stats_increase_irq()
@@ -98,7 +98,7 @@ extern "C" {
#define _stats_start_measure_crit_isr()
#define _stats_stop_measure_crit_isr()
-#endif /* !CH_DBG_STATISTICS */
+#endif /* CH_DBG_STATISTICS == FALSE */
#endif /* _CHSTATS_H_ */
diff --git a/os/rt/include/chsys.h b/os/rt/include/chsys.h
index ce3ae530e..88814fa16 100644
--- a/os/rt/include/chsys.h
+++ b/os/rt/include/chsys.h
@@ -197,7 +197,7 @@
*
* @xclass
*/
-#if PORT_SUPPORTS_RT || defined(__DOXYGEN__)
+#if (PORT_SUPPORTS_RT == TRUE) || defined(__DOXYGEN__)
#define chSysGetRealtimeCounterX() (rtcnt_t)port_rt_get_counter_value()
#endif
@@ -388,7 +388,7 @@ static inline void chSysUnconditionalUnlock(void) {
}
}
-#if !CH_CFG_NO_IDLE_THREAD || defined(__DOXYGEN__)
+#if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__)
/**
* @brief Returns a pointer to the idle thread.
* @pre In order to use this function the option @p CH_CFG_NO_IDLE_THREAD
@@ -405,7 +405,7 @@ static inline thread_t *chSysGetIdleThreadX(void) {
return ch.rlist.r_queue.p_prev;
}
-#endif /* !CH_CFG_NO_IDLE_THREAD */
+#endif /* CH_CFG_NO_IDLE_THREAD == FALSE */
#endif /* _CHSYS_H_ */
diff --git a/os/rt/include/chsystypes.h b/os/rt/include/chsystypes.h
index 9fe672267..cf101e0db 100644
--- a/os/rt/include/chsystypes.h
+++ b/os/rt/include/chsystypes.h
@@ -84,7 +84,7 @@ typedef struct ch_ready_list ready_list_t;
/**
* @brief Type of a Virtual Timer callback function.
*/
-typedef void (*vtfunc_t)(void *);
+typedef void (*vtfunc_t)(void *p);
/**
* @brief Type of a Virtual Timer structure.
diff --git a/os/rt/include/chthreads.h b/os/rt/include/chthreads.h
index 60d303f95..44b9e2032 100644
--- a/os/rt/include/chthreads.h
+++ b/os/rt/include/chthreads.h
@@ -52,7 +52,7 @@ typedef thread_t * thread_reference_t;
/**
* @brief Thread function.
*/
-typedef msg_t (*tfunc_t)(void *);
+typedef msg_t (*tfunc_t)(void *p);
/*===========================================================================*/
/* Module macros. */
@@ -132,7 +132,7 @@ typedef msg_t (*tfunc_t)(void *);
extern "C" {
#endif
thread_t *_thread_init(thread_t *tp, tprio_t prio);
-#if CH_DBG_FILL_THREADS
+#if CH_DBG_FILL_THREADS == TRUE
void _thread_memfill(uint8_t *startp, uint8_t *endp, uint8_t v);
#endif
thread_t *chThdCreateI(void *wsp, size_t size,
@@ -156,7 +156,7 @@ extern "C" {
void chThdYield(void);
void chThdExit(msg_t msg);
void chThdExitS(msg_t msg);
-#if CH_CFG_USE_WAITEXIT
+#if CH_CFG_USE_WAITEXIT == TRUE
msg_t chThdWait(thread_t *tp);
#endif
#ifdef __cplusplus
@@ -202,7 +202,7 @@ static inline tprio_t chThdGetPriorityX(void) {
*
* @xclass
*/
-#if CH_DBG_THREADS_PROFILING || defined(__DOXYGEN__)
+#if (CH_DBG_THREADS_PROFILING == TRUE) || defined(__DOXYGEN__)
static inline systime_t chThdGetTicksX(thread_t *tp) {
return tp->p_time;
@@ -233,7 +233,7 @@ static inline bool chThdTerminatedX(thread_t *tp) {
*/
static inline bool chThdShouldTerminateX(void) {
- return (bool)((chThdGetSelfX()->p_flags & CH_FLAG_TERMINATE) != 0);
+ return (bool)((chThdGetSelfX()->p_flags & CH_FLAG_TERMINATE) != 0U);
}
/**
@@ -268,7 +268,7 @@ static inline void chThdSleepS(systime_t time) {
chDbgCheck(time != TIME_IMMEDIATE);
- chSchGoSleepTimeoutS(CH_STATE_SLEEPING, time);
+ (void) chSchGoSleepTimeoutS(CH_STATE_SLEEPING, time);
}
/**
@@ -322,7 +322,7 @@ static inline void chThdDoDequeueNextI(threads_queue_t *tqp, msg_t msg) {
chDbgAssert(tp->p_state == CH_STATE_QUEUED, "invalid state");
tp->p_u.rdymsg = msg;
- chSchReadyI(tp);
+ (void) chSchReadyI(tp);
}
#endif /* _CHTHREADS_H_ */
diff --git a/os/rt/include/chtm.h b/os/rt/include/chtm.h
index d6693869e..e072ff33e 100644
--- a/os/rt/include/chtm.h
+++ b/os/rt/include/chtm.h
@@ -28,7 +28,7 @@
#ifndef _CHTM_H_
#define _CHTM_H_
-#if CH_CFG_USE_TM || defined(__DOXYGEN__)
+#if (CH_CFG_USE_TM == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module constants. */
@@ -42,7 +42,7 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if !PORT_SUPPORTS_RT
+#if PORT_SUPPORTS_RT == FALSE
#error "CH_CFG_USE_TM requires PORT_SUPPORTS_RT"
#endif
@@ -102,7 +102,7 @@ extern "C" {
/* Module inline functions. */
/*===========================================================================*/
-#endif /* CH_CFG_USE_TM */
+#endif /* CH_CFG_USE_TM == TRUE */
#endif /* _CHTM_H_ */
diff --git a/os/rt/include/chvt.h b/os/rt/include/chvt.h
index f0a8f00d6..d461ccbfa 100644
--- a/os/rt/include/chvt.h
+++ b/os/rt/include/chvt.h
@@ -78,7 +78,7 @@
#error "CH_CFG_TIME_QUANTUM not supported in tickless mode"
#endif
-#if (CH_CFG_ST_TIMEDELTA > 0) && CH_DBG_THREADS_PROFILING
+#if (CH_CFG_ST_TIMEDELTA > 0) && (CH_DBG_THREADS_PROFILING == TRUE)
#error "CH_DBG_THREADS_PROFILING not supported in tickless mode"
#endif
@@ -283,7 +283,7 @@ static inline bool chVTIsTimeWithinX(systime_t time,
systime_t start,
systime_t end) {
- return (bool)(time - start < end - start);
+ return (bool)((time - start) < (end - start));
}
/**
@@ -476,7 +476,8 @@ static inline void chVTDoTickI(void) {
/* The next element is outside the current time window, the loop
is stopped here.*/
- if ((vtp = ch.vtlist.vt_next)->vt_delta > delta) {
+ vtp = ch.vtlist.vt_next;
+ if (vtp->vt_delta > delta) {
break;
}
@@ -485,17 +486,21 @@ static inline void chVTDoTickI(void) {
ch.vtlist.vt_lasttime += vtp->vt_delta;
/* The timer is removed from the list and marked as non-armed.*/
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
vtp->vt_next->vt_prev = (virtual_timer_t *)&ch.vtlist;
+ /*lint -restore*/
ch.vtlist.vt_next = vtp->vt_next;
fn = vtp->vt_func;
- vtp->vt_func = (vtfunc_t)NULL;
+ vtp->vt_func = NULL;
/* The callback is invoked outside the kernel critical zone.*/
chSysUnlockFromISR();
fn(vtp->vt_par);
chSysLockFromISR();
}
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
if (&ch.vtlist == (virtual_timers_list_t *)ch.vtlist.vt_next) {
+ /*lint -restore*/
/* The list is empty, no tick event needed so the alarm timer
is stopped.*/
port_timer_stop_alarm();
@@ -503,11 +508,11 @@ static inline void chVTDoTickI(void) {
else {
/* Updating the alarm to the next deadline, deadline that must not be
closer in time than the minimum time delta.*/
- if (vtp->vt_delta >= CH_CFG_ST_TIMEDELTA) {
+ if (vtp->vt_delta >= (systime_t)CH_CFG_ST_TIMEDELTA) {
port_timer_set_alarm(now + vtp->vt_delta);
}
else {
- port_timer_set_alarm(now + CH_CFG_ST_TIMEDELTA);
+ port_timer_set_alarm(now + (systime_t)CH_CFG_ST_TIMEDELTA);
}
}
#endif /* CH_CFG_ST_TIMEDELTA > 0 */
diff --git a/os/rt/ports/ARM/compilers/GCC/chtypes.h b/os/rt/ports/ARM/compilers/GCC/chtypes.h
index c9a827dca..72674a53f 100644
--- a/os/rt/ports/ARM/compilers/GCC/chtypes.h
+++ b/os/rt/ports/ARM/compilers/GCC/chtypes.h
@@ -46,7 +46,7 @@
* @brief Generic 'true' boolean constant.
*/
#if !defined(TRUE) || defined(__DOXYGEN__)
-#define TRUE (!FALSE)
+#define TRUE 1
#endif
/** @} */
diff --git a/os/rt/ports/ARMCMx/chcore.h b/os/rt/ports/ARMCMx/chcore.h
index 4a8ebb324..23f33a6f8 100644
--- a/os/rt/ports/ARMCMx/chcore.h
+++ b/os/rt/ports/ARMCMx/chcore.h
@@ -179,7 +179,7 @@ struct context {
/**
* @brief Total priority levels.
*/
-#define CORTEX_PRIORITY_LEVELS (1 << CORTEX_PRIORITY_BITS)
+#define CORTEX_PRIORITY_LEVELS (1U << CORTEX_PRIORITY_BITS)
/**
* @brief Minimum priority level.
@@ -192,7 +192,7 @@ struct context {
* @brief Maximum priority level.
* @details The maximum allowed priority level is always zero.
*/
-#define CORTEX_MAXIMUM_PRIORITY 0
+#define CORTEX_MAXIMUM_PRIORITY 0U
/**
* @brief Priority level verification macro.
@@ -210,7 +210,7 @@ struct context {
* @brief Priority level to priority mask conversion macro.
*/
#define CORTEX_PRIO_MASK(n) \
- ((n) << (8 - CORTEX_PRIORITY_BITS))
+ ((n) << (8U - (unsigned)CORTEX_PRIORITY_BITS))
/*===========================================================================*/
/* External declarations. */
@@ -231,11 +231,11 @@ struct context {
#if !defined(_FROM_ASM_)
#if CH_CFG_ST_TIMEDELTA > 0
-#if !PORT_USE_ALT_TIMER
+#if PORT_USE_ALT_TIMER == FALSE
#include "chcore_timer.h"
-#else /* PORT_USE_ALT_TIMER */
+#else /* PORT_USE_ALT_TIMER != FALSE */
#include "chcore_timer_alt.h"
-#endif /* PORT_USE_ALT_TIMER */
+#endif /* PORT_USE_ALT_TIMER != FALSE */
#endif /* CH_CFG_ST_TIMEDELTA > 0 */
#endif /* !defined(_FROM_ASM_) */
diff --git a/os/rt/ports/ARMCMx/chcore_v6m.h b/os/rt/ports/ARMCMx/chcore_v6m.h
index 3ded54449..3c28c0f54 100644
--- a/os/rt/ports/ARMCMx/chcore_v6m.h
+++ b/os/rt/ports/ARMCMx/chcore_v6m.h
@@ -33,42 +33,6 @@
/*===========================================================================*/
/**
- * @name Architecture and Compiler
- * @{
- */
-#if (CORTEX_MODEL == CORTEX_M0) || defined(__DOXYGEN__)
-/**
- * @brief Macro defining the specific ARM architecture.
- */
-#define PORT_ARCHITECTURE_ARM_v6M
-
-/**
- * @brief Name of the implemented architecture.
- */
-#define PORT_ARCHITECTURE_NAME "ARMv6-M"
-
-/**
- * @brief Name of the architecture variant.
- */
-#define PORT_CORE_VARIANT_NAME "Cortex-M0"
-
-#elif (CORTEX_MODEL == CORTEX_M0PLUS)
-#define PORT_ARCHITECTURE_ARM_v6M
-#define PORT_ARCHITECTURE_NAME "ARMv6-M"
-#define PORT_CORE_VARIANT_NAME "Cortex-M0+"
-#endif
-
-/**
- * @brief Port-specific information string.
- */
-#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
-#define PORT_INFO "Preemption through NMI"
-#else
-#define PORT_INFO "Preemption through PendSV"
-#endif
-/** @} */
-
-/**
* @brief This port does not support a realtime counter.
*/
#define PORT_SUPPORTS_RT FALSE
@@ -132,6 +96,42 @@
/*===========================================================================*/
/**
+ * @name Architecture and Compiler
+ * @{
+ */
+#if (CORTEX_MODEL == CORTEX_M0) || defined(__DOXYGEN__)
+/**
+ * @brief Macro defining the specific ARM architecture.
+ */
+#define PORT_ARCHITECTURE_ARM_v6M
+
+/**
+ * @brief Name of the implemented architecture.
+ */
+#define PORT_ARCHITECTURE_NAME "ARMv6-M"
+
+/**
+ * @brief Name of the architecture variant.
+ */
+#define PORT_CORE_VARIANT_NAME "Cortex-M0"
+
+#elif (CORTEX_MODEL == CORTEX_M0PLUS)
+#define PORT_ARCHITECTURE_ARM_v6M
+#define PORT_ARCHITECTURE_NAME "ARMv6-M"
+#define PORT_CORE_VARIANT_NAME "Cortex-M0+"
+#endif
+
+/**
+ * @brief Port-specific information string.
+ */
+#if !CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
+#define PORT_INFO "Preemption through NMI"
+#else
+#define PORT_INFO "Preemption through PendSV"
+#endif
+/** @} */
+
+/**
* @brief Maximum usable priority for normal ISRs.
*/
#if CORTEX_ALTERNATE_SWITCH || defined(__DOXYGEN__)
diff --git a/os/rt/ports/ARMCMx/chcore_v7m.h b/os/rt/ports/ARMCMx/chcore_v7m.h
index 80faaefc9..3d72723fb 100644
--- a/os/rt/ports/ARMCMx/chcore_v7m.h
+++ b/os/rt/ports/ARMCMx/chcore_v7m.h
@@ -33,46 +33,6 @@
/*===========================================================================*/
/**
- * @name Architecture and Compiler
- * @{
- */
-#if (CORTEX_MODEL == CORTEX_M3) || defined(__DOXYGEN__)
-/**
- * @brief Macro defining the specific ARM architecture.
- */
-#define PORT_ARCHITECTURE_ARM_v7M
-
-/**
- * @brief Name of the implemented architecture.
- */
-#define PORT_ARCHITECTURE_NAME "ARMv7-M"
-
-/**
- * @brief Name of the architecture variant.
- */
-#define PORT_CORE_VARIANT_NAME "Cortex-M3"
-
-#elif (CORTEX_MODEL == CORTEX_M4)
-#define PORT_ARCHITECTURE_ARM_v7ME
-#define PORT_ARCHITECTURE_NAME "ARMv7-ME"
-#if CORTEX_USE_FPU
-#define PORT_CORE_VARIANT_NAME "Cortex-M4F"
-#else
-#define PORT_CORE_VARIANT_NAME "Cortex-M4"
-#endif
-#endif
-
-/**
- * @brief Port-specific information string.
- */
-#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
-#define PORT_INFO "Advanced kernel mode"
-#else
-#define PORT_INFO "Compact kernel mode"
-#endif
-/** @} */
-
-/**
* @brief This port supports a realtime counter.
*/
#define PORT_SUPPORTS_RT TRUE
@@ -80,7 +40,7 @@
/**
* @brief Disabled value for BASEPRI register.
*/
-#define CORTEX_BASEPRI_DISABLED 0
+#define CORTEX_BASEPRI_DISABLED 0U
/*===========================================================================*/
/* Module pre-compile time settings. */
@@ -149,7 +109,7 @@
* priority level.
*/
#if !defined(CORTEX_PRIORITY_SVCALL)
-#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1)
+#define CORTEX_PRIORITY_SVCALL (CORTEX_MAXIMUM_PRIORITY + 1U)
#elif !CORTEX_IS_VALID_PRIORITY(CORTEX_PRIORITY_SVCALL)
/* If it is externally redefined then better perform a validity check on it.*/
#error "invalid priority level specified for CORTEX_PRIORITY_SVCALL"
@@ -159,7 +119,7 @@
* @brief NVIC VTOR initialization expression.
*/
#if !defined(CORTEX_VTOR_INIT) || defined(__DOXYGEN__)
-#define CORTEX_VTOR_INIT 0x00000000
+#define CORTEX_VTOR_INIT 0x00000000U
#endif
/**
@@ -175,11 +135,51 @@
/* Derived constants and error checks. */
/*===========================================================================*/
-#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
+/**
+ * @name Architecture and Compiler
+ * @{
+ */
+#if (CORTEX_MODEL == CORTEX_M3) || defined(__DOXYGEN__)
+/**
+ * @brief Macro defining the specific ARM architecture.
+ */
+#define PORT_ARCHITECTURE_ARM_v7M
+
+/**
+ * @brief Name of the implemented architecture.
+ */
+#define PORT_ARCHITECTURE_NAME "ARMv7-M"
+
+/**
+ * @brief Name of the architecture variant.
+ */
+#define PORT_CORE_VARIANT_NAME "Cortex-M3"
+
+#elif (CORTEX_MODEL == CORTEX_M4)
+#define PORT_ARCHITECTURE_ARM_v7ME
+#define PORT_ARCHITECTURE_NAME "ARMv7-ME"
+#if CORTEX_USE_FPU
+#define PORT_CORE_VARIANT_NAME "Cortex-M4F"
+#else
+#define PORT_CORE_VARIANT_NAME "Cortex-M4"
+#endif
+#endif
+
+/**
+ * @brief Port-specific information string.
+ */
+#if (CORTEX_SIMPLIFIED_PRIORITY == FALSE) || defined(__DOXYGEN__)
+#define PORT_INFO "Advanced kernel mode"
+#else
+#define PORT_INFO "Compact kernel mode"
+#endif
+/** @} */
+
+#if (CORTEX_SIMPLIFIED_PRIORITY == FALSE) || defined(__DOXYGEN__)
/**
* @brief Maximum usable priority for normal ISRs.
*/
-#define CORTEX_MAX_KERNEL_PRIORITY (CORTEX_PRIORITY_SVCALL + 1)
+#define CORTEX_MAX_KERNEL_PRIORITY (CORTEX_PRIORITY_SVCALL + 1U)
/**
* @brief BASEPRI level within kernel lock.
@@ -188,7 +188,7 @@
CORTEX_PRIO_MASK(CORTEX_MAX_KERNEL_PRIORITY)
#else
-#define CORTEX_MAX_KERNEL_PRIORITY 0
+#define CORTEX_MAX_KERNEL_PRIORITY 0U
#endif
/**
@@ -336,7 +336,7 @@ struct port_intctx {
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
*/
-#if !CH_DBG_ENABLE_STACK_CHECK || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_STACK_CHECK == FALSE) || defined(__DOXYGEN__)
#define port_switch(ntp, otp) _port_switch(ntp, otp)
#else
#define port_switch(ntp, otp) { \
@@ -383,7 +383,7 @@ static inline void port_init(void) {
DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk;
/* Initialization of the system vectors used by the port.*/
-#if !CORTEX_SIMPLIFIED_PRIORITY
+#if CORTEX_SIMPLIFIED_PRIORITY == FALSE
NVIC_SetPriority(SVCall_IRQn, CORTEX_PRIORITY_SVCALL);
#endif
NVIC_SetPriority(PendSV_IRQn, CORTEX_PRIORITY_PENDSV);
@@ -397,7 +397,7 @@ static inline void port_init(void) {
static inline syssts_t port_get_irq_status(void) {
uint32_t sts;
-#if !CORTEX_SIMPLIFIED_PRIORITY
+#if CORTEX_SIMPLIFIED_PRIORITY == FALSE
sts = __get_BASEPRI();
#else /* CORTEX_SIMPLIFIED_PRIORITY */
sts = __get_PRIMASK();
@@ -416,7 +416,7 @@ static inline syssts_t port_get_irq_status(void) {
*/
static inline bool port_irq_enabled(syssts_t sts) {
-#if !CORTEX_SIMPLIFIED_PRIORITY
+#if CORTEX_SIMPLIFIED_PRIORITY == FALSE
return sts == CORTEX_BASEPRI_DISABLED;
#else /* CORTEX_SIMPLIFIED_PRIORITY */
return (sts & 1) == 0;
@@ -432,7 +432,7 @@ static inline bool port_irq_enabled(syssts_t sts) {
*/
static inline bool port_is_isr_context(void) {
- return (bool)((__get_IPSR() & 0x1FF) != 0);
+ return (bool)((__get_IPSR() & 0x1FFU) != 0U);
}
/**
@@ -442,7 +442,7 @@ static inline bool port_is_isr_context(void) {
*/
static inline void port_lock(void) {
-#if !CORTEX_SIMPLIFIED_PRIORITY
+#if CORTEX_SIMPLIFIED_PRIORITY == FALSE
__set_BASEPRI(CORTEX_BASEPRI_KERNEL);
#else /* CORTEX_SIMPLIFIED_PRIORITY */
__disable_irq();
@@ -456,7 +456,7 @@ static inline void port_lock(void) {
*/
static inline void port_unlock(void) {
-#if !CORTEX_SIMPLIFIED_PRIORITY
+#if CORTEX_SIMPLIFIED_PRIORITY == FALSE
__set_BASEPRI(CORTEX_BASEPRI_DISABLED);
#else /* CORTEX_SIMPLIFIED_PRIORITY */
__enable_irq();
@@ -502,7 +502,7 @@ static inline void port_disable(void) {
*/
static inline void port_suspend(void) {
-#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
+#if (CORTEX_SIMPLIFIED_PRIORITY == FALSE) || defined(__DOXYGEN__)
__set_BASEPRI(CORTEX_BASEPRI_KERNEL);
__enable_irq();
#else
@@ -516,7 +516,7 @@ static inline void port_suspend(void) {
*/
static inline void port_enable(void) {
-#if !CORTEX_SIMPLIFIED_PRIORITY || defined(__DOXYGEN__)
+#if (CORTEX_SIMPLIFIED_PRIORITY == FALSE) || defined(__DOXYGEN__)
__set_BASEPRI(CORTEX_BASEPRI_DISABLED);
#endif
__enable_irq();
@@ -532,7 +532,7 @@ static inline void port_enable(void) {
*/
static inline void port_wait_for_interrupt(void) {
-#if CORTEX_ENABLE_WFI_IDLE
+#if CORTEX_ENABLE_WFI_IDLE == TRUE
__WFI();
#endif
}
diff --git a/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h b/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h
index cc403c99a..25ed63a90 100644
--- a/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h
+++ b/os/rt/ports/ARMCMx/compilers/GCC/chtypes.h
@@ -40,13 +40,14 @@
*/
#if !defined(FALSE) || defined(__DOXYGEN__)
#define FALSE 0
+
#endif
/**
* @brief Generic 'true' boolean constant.
*/
#if !defined(TRUE) || defined(__DOXYGEN__)
-#define TRUE (!FALSE)
+#define TRUE 1
#endif
/** @} */
diff --git a/os/rt/ports/SIMIA32/compilers/GCC/chtypes.h b/os/rt/ports/SIMIA32/compilers/GCC/chtypes.h
index 2ee7892c9..252bba104 100644
--- a/os/rt/ports/SIMIA32/compilers/GCC/chtypes.h
+++ b/os/rt/ports/SIMIA32/compilers/GCC/chtypes.h
@@ -46,7 +46,7 @@
* @brief Generic 'true' boolean constant.
*/
#if !defined(TRUE) || defined(__DOXYGEN__)
-#define TRUE (!FALSE)
+#define TRUE 1
#endif
/** @} */
diff --git a/os/rt/ports/e200/compilers/GCC/chtypes.h b/os/rt/ports/e200/compilers/GCC/chtypes.h
index 4e9f49c36..87bb6b74d 100644
--- a/os/rt/ports/e200/compilers/GCC/chtypes.h
+++ b/os/rt/ports/e200/compilers/GCC/chtypes.h
@@ -46,7 +46,7 @@
* @brief Generic 'true' boolean constant.
*/
#if !defined(TRUE) || defined(__DOXYGEN__)
-#define TRUE (!FALSE)
+#define TRUE 1
#endif
/** @} */
diff --git a/os/rt/src/chdebug.c b/os/rt/src/chdebug.c
index eef4128d0..a09f327b4 100644
--- a/os/rt/src/chdebug.c
+++ b/os/rt/src/chdebug.c
@@ -105,7 +105,7 @@
/* Module exported functions. */
/*===========================================================================*/
-#if CH_DBG_SYSTEM_STATE_CHECK || defined(__DOXYGEN__)
+#if (CH_DBG_SYSTEM_STATE_CHECK == TRUE) || defined(__DOXYGEN__)
/**
* @brief Guard code for @p chSysDisable().
*
@@ -254,9 +254,9 @@ void chDbgCheckClassS(void) {
}
}
-#endif /* CH_DBG_SYSTEM_STATE_CHECK */
+#endif /* CH_DBG_SYSTEM_STATE_CHECK == TRUE */
-#if CH_DBG_ENABLE_TRACE || defined(__DOXYGEN__)
+#if (CH_DBG_ENABLE_TRACE == TRUE) || defined(__DOXYGEN__)
/**
* @brief Trace circular buffer subsystem initialization.
* @note Internal use only.
diff --git a/os/rt/src/chdynamic.c b/os/rt/src/chdynamic.c
index 78a667966..9a0c33303 100644
--- a/os/rt/src/chdynamic.c
+++ b/os/rt/src/chdynamic.c
@@ -68,9 +68,10 @@
thread_t *chThdAddRef(thread_t *tp) {
chSysLock();
- chDbgAssert(tp->p_refs < 255, "too many references");
+ chDbgAssert(tp->p_refs < 255U, "too many references");
tp->p_refs++;
chSysUnlock();
+
return tp;
}
@@ -98,7 +99,7 @@ void chThdRelease(thread_t *tp) {
/* If the references counter reaches zero and the thread is in its
terminated state then the memory can be returned to the proper
allocator. Of course static threads are not affected.*/
- if ((refs == 0) && (tp->p_state == CH_STATE_FINAL)) {
+ if ((refs == 0U) && (tp->p_state == CH_STATE_FINAL)) {
switch (tp->p_flags & CH_FLAG_MODE_MASK) {
#if CH_CFG_USE_HEAP
case CH_FLAG_MODE_HEAP:
diff --git a/os/rt/src/chqueues.c b/os/rt/src/chqueues.c
index 07f1ca230..f85cac9bc 100644
--- a/os/rt/src/chqueues.c
+++ b/os/rt/src/chqueues.c
@@ -295,7 +295,7 @@ void chOQResetI(output_queue_t *oqp) {
chDbgCheckClassI();
oqp->q_rdptr = oqp->q_wrptr = oqp->q_buffer;
- oqp->q_counter = chQSizeI(oqp);
+ oqp->q_counter = QSIZE(oqp);
chThdDequeueAllI(&oqp->q_waiting, Q_RESET);
}
diff --git a/os/rt/src/chregistry.c b/os/rt/src/chregistry.c
index 043fb1516..157d90d11 100644
--- a/os/rt/src/chregistry.c
+++ b/os/rt/src/chregistry.c
@@ -75,12 +75,12 @@
* OS signature in ROM plus debug-related information.
*/
ROMCONST chdebug_t ch_debug = {
- "main",
+ {'m', 'a', 'i', 'n'},
(uint8_t)0,
(uint8_t)sizeof (chdebug_t),
(uint16_t)((CH_KERNEL_MAJOR << 11) |
(CH_KERNEL_MINOR << 6) |
- (CH_KERNEL_PATCH) << 0),
+ (CH_KERNEL_PATCH << 0)),
(uint8_t)sizeof (void *),
(uint8_t)sizeof (systime_t),
(uint8_t)sizeof (thread_t),
diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c
index 2640f25e9..03d5259ed 100644
--- a/os/rt/src/chschd.c
+++ b/os/rt/src/chschd.c
@@ -66,12 +66,15 @@ void _scheduler_init(void) {
queue_init(&ch.rlist.r_queue);
ch.rlist.r_prio = NOPRIO;
-#if CH_CFG_USE_REGISTRY
- ch.rlist.r_newer = ch.rlist.r_older = (thread_t *)&ch.rlist;
+#if CH_CFG_USE_REGISTRY == TRUE
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ ch.rlist.r_newer = (thread_t *)&ch.rlist;
+ ch.rlist.r_older = (thread_t *)&ch.rlist;
+ /*lint -restore*/
#endif
}
-#if !CH_CFG_OPTIMIZE_SPEED || defined(__DOXYGEN__)
+#if (CH_CFG_OPTIMIZE_SPEED == FALSE) || defined(__DOXYGEN__)
/**
* @brief Inserts a thread into a priority ordered queue.
* @note The insertion is done by scanning the list from the highest
@@ -224,14 +227,17 @@ thread_t *chSchReadyI(thread_t *tp) {
"invalid state");
tp->p_state = CH_STATE_READY;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
cp = (thread_t *)&ch.rlist.r_queue;
+ /*lint -restore*/
do {
cp = cp->p_next;
} while (cp->p_prio >= tp->p_prio);
/* Insertion on p_prev.*/
tp->p_next = cp;
tp->p_prev = cp->p_prev;
- tp->p_prev->p_next = cp->p_prev = tp;
+ tp->p_prev->p_next = tp;
+ cp->p_prev = tp;
return tp;
}
@@ -250,7 +256,8 @@ void chSchGoSleepS(tstate_t newstate) {
chDbgCheckClassS();
- (otp = currp)->p_state = newstate;
+ otp = currp;
+ otp->p_state = newstate;
#if CH_CFG_TIME_QUANTUM > 0
/* The thread is renouncing its remaining time slices so it will have a new
time quantum when it will wakeup.*/
@@ -270,7 +277,9 @@ void chSchGoSleepS(tstate_t newstate) {
* Timeout wakeup callback.
*/
static void wakeup(void *p) {
+ /*lint -save -e9087 [11.3] The real type is hidden but correct.*/
thread_t *tp = (thread_t *)p;
+ /*lint -restore*/
chSysLockFromISR();
switch (tp->p_state) {
@@ -282,20 +291,24 @@ static void wakeup(void *p) {
case CH_STATE_SUSPENDED:
*(thread_reference_t *)tp->p_u.wtobjp = NULL;
break;
-#if CH_CFG_USE_SEMAPHORES
+#if CH_CFG_USE_SEMAPHORES == TRUE
case CH_STATE_WTSEM:
chSemFastSignalI((semaphore_t *)tp->p_u.wtobjp);
/* Falls into, intentional. */
#endif
-#if CH_CFG_USE_CONDVARS && CH_CFG_USE_CONDVARS_TIMEOUT
+#if (CH_CFG_USE_CONDVARS == TRUE) && (CH_CFG_USE_CONDVARS_TIMEOUT == TRUE)
case CH_STATE_WTCOND:
#endif
case CH_STATE_QUEUED:
/* States requiring dequeuing.*/
- queue_dequeue(tp);
+ (void) queue_dequeue(tp);
+ break;
+ default:
+ chDbgAssert(false, "unexpected state");
+ break;
}
tp->p_u.rdymsg = MSG_TIMEOUT;
- chSchReadyI(tp);
+ (void) chSchReadyI(tp);
chSysUnlockFromISR();
}
@@ -329,8 +342,9 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
chVTDoSetI(&vt, time, wakeup, currp);
chSchGoSleepS(newstate);
- if (chVTIsArmedI(&vt))
+ if (chVTIsArmedI(&vt)) {
chVTDoResetI(&vt);
+ }
}
else {
chSchGoSleepS(newstate);
@@ -369,7 +383,7 @@ void chSchWakeupS(thread_t *ntp, msg_t msg) {
running immediately and the invoking thread goes in the ready
list instead.*/
if (ntp->p_prio <= currp->p_prio) {
- chSchReadyI(ntp);
+ (void) chSchReadyI(ntp);
}
else {
thread_t *otp = chSchReadyI(currp);
@@ -455,7 +469,7 @@ void chSchDoRescheduleBehind(void) {
#if CH_CFG_TIME_QUANTUM > 0
otp->p_preempt = CH_CFG_TIME_QUANTUM;
#endif
- chSchReadyI(otp);
+ (void) chSchReadyI(otp);
chSysSwitch(currp, otp);
}
@@ -482,14 +496,17 @@ void chSchDoRescheduleAhead(void) {
currp->p_state = CH_STATE_CURRENT;
otp->p_state = CH_STATE_READY;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
cp = (thread_t *)&ch.rlist.r_queue;
+ /*lint -restore*/
do {
cp = cp->p_next;
} while (cp->p_prio > otp->p_prio);
/* Insertion on p_prev.*/
otp->p_next = cp;
otp->p_prev = cp->p_prev;
- otp->p_prev->p_next = cp->p_prev = otp;
+ otp->p_prev->p_next = otp;
+ cp->p_prev = otp;
chSysSwitch(currp, otp);
}
diff --git a/os/rt/src/chstats.c b/os/rt/src/chstats.c
index fc695d0fe..fbd28f44a 100644
--- a/os/rt/src/chstats.c
+++ b/os/rt/src/chstats.c
@@ -28,7 +28,7 @@
#include "ch.h"
-#if CH_DBG_STATISTICS || defined(__DOXYGEN__)
+#if (CH_DBG_STATISTICS == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module local definitions. */
@@ -119,6 +119,6 @@ void _stats_stop_measure_crit_isr(void) {
chTMStopMeasurementX(&ch.kernel_stats.m_crit_isr);
}
-#endif /* CH_DBG_STATISTICS */
+#endif /* CH_DBG_STATISTICS == TRUE */
/** @} */
diff --git a/os/rt/src/chsys.c b/os/rt/src/chsys.c
index 7823409f3..4e2102b89 100644
--- a/os/rt/src/chsys.c
+++ b/os/rt/src/chsys.c
@@ -51,7 +51,7 @@
/* Module local functions. */
/*===========================================================================*/
-#if !CH_CFG_NO_IDLE_THREAD || defined(__DOXYGEN__)
+#if (CH_CFG_NO_IDLE_THREAD == FALSE) || defined(__DOXYGEN__)
/**
* @brief This function implements the idle thread infinite loop.
* @details The function puts the processor in the lowest power mode capable
@@ -67,11 +67,14 @@ static void _idle_thread(void *p) {
(void)p;
chRegSetThreadName("idle");
while (true) {
+ /*lint -save -e522 [2.2] Apparently no side effects because it contains
+ an asm instruction.*/
port_wait_for_interrupt();
+ /*lint -restore*/
CH_CFG_IDLE_LOOP_HOOK();
}
}
-#endif /* CH_CFG_NO_IDLE_THREAD */
+#endif /* CH_CFG_NO_IDLE_THREAD == FALSE */
/*===========================================================================*/
/* Module exported functions. */
@@ -88,30 +91,30 @@ static void _idle_thread(void *p) {
* @special
*/
void chSysInit(void) {
-#if CH_DBG_ENABLE_STACK_CHECK
+#if CH_DBG_ENABLE_STACK_CHECK == TRUE
extern stkalign_t __main_thread_stack_base__;
#endif
port_init();
_scheduler_init();
_vt_init();
-#if CH_CFG_USE_TM
+#if CH_CFG_USE_TM == TRUE
_tm_init();
#endif
-#if CH_CFG_USE_MEMCORE
+#if CH_CFG_USE_MEMCORE == TRUE
_core_init();
#endif
-#if CH_CFG_USE_HEAP
+#if CH_CFG_USE_HEAP == TRUE
_heap_init();
#endif
-#if CH_DBG_STATISTICS
+#if CH_DBG_STATISTICS == TRUE
_stats_init();
#endif
-#if CH_DBG_ENABLE_TRACE
+#if CH_DBG_ENABLE_TRACE == TRUE
_dbg_trace_init();
#endif
-#if !CH_CFG_NO_IDLE_THREAD
+#if CH_CFG_NO_IDLE_THREAD == FALSE
/* Now this instructions flow becomes the main thread.*/
setcurrp(_thread_init(&ch.mainthread, NORMALPRIO));
#else
@@ -120,7 +123,7 @@ void chSysInit(void) {
#endif
currp->p_state = CH_STATE_CURRENT;
-#if CH_DBG_ENABLE_STACK_CHECK
+#if CH_DBG_ENABLE_STACK_CHECK == TRUE
/* This is a special case because the main thread thread_t structure is not
adjacent to its stack area.*/
currp->p_stklimit = &__main_thread_stack_base__;
@@ -131,12 +134,15 @@ void chSysInit(void) {
active, else the parameter is ignored.*/
chRegSetThreadName((const char *)&ch_debug);
-#if !CH_CFG_NO_IDLE_THREAD
+#if CH_CFG_NO_IDLE_THREAD == FALSE
/* This thread has the lowest priority in the system, its role is just to
serve interrupts in its context while keeping the lowest energy saving
mode compatible with the system status.*/
- chThdCreateStatic(ch.idle_thread_wa, sizeof(ch.idle_thread_wa), IDLEPRIO,
- (tfunc_t)_idle_thread, NULL);
+ /*lint -save -e9074 -e9087 [11.3, 11.1] The idle thread returns void because
+ an optimization.*/
+ (void) chThdCreateStatic(ch.idle_thread_wa, sizeof(ch.idle_thread_wa),
+ IDLEPRIO, (tfunc_t)_idle_thread, NULL);
+ /*lint -restore*/
#endif
}
@@ -189,7 +195,7 @@ void chSysTimerHandlerI(void) {
/* Decrement remaining quantum.*/
currp->p_preempt--;
#endif
-#if CH_DBG_THREADS_PROFILING
+#if CH_DBG_THREADS_PROFILING == TRUE
currp->p_time++;
#endif
chVTDoTickI();
@@ -247,7 +253,7 @@ void chSysRestoreStatusX(syssts_t sts) {
}
}
-#if PORT_SUPPORTS_RT || defined(__DOXYGEN__)
+#if (PORT_SUPPORTS_RT == TRUE) || defined(__DOXYGEN__)
/**
* @brief Realtime window test.
* @details This function verifies if the current realtime counter value
@@ -268,8 +274,8 @@ void chSysRestoreStatusX(syssts_t sts) {
*/
bool chSysIsCounterWithinX(rtcnt_t cnt, rtcnt_t start, rtcnt_t end) {
- return end > start ? (cnt >= start) && (cnt < end) :
- (cnt >= start) || (cnt < end);
+ return (end > start) ? ((cnt >= start) && (cnt < end)) :
+ ((cnt >= start) || (cnt < end));
}
/**
@@ -290,6 +296,6 @@ void chSysPolledDelayX(rtcnt_t cycles) {
while (chSysIsCounterWithinX(chSysGetRealtimeCounterX(), start, end)) {
}
}
-#endif /* PORT_SUPPORTS_RT */
+#endif /* PORT_SUPPORTS_RT == TRUE */
/** @} */
diff --git a/os/rt/src/chthreads.c b/os/rt/src/chthreads.c
index 12d045a84..16a80aaab 100644
--- a/os/rt/src/chthreads.c
+++ b/os/rt/src/chthreads.c
@@ -571,7 +571,7 @@ void chThdResumeI(thread_reference_t *trp, msg_t msg) {
*trp = NULL;
tp->p_u.rdymsg = msg;
- chSchReadyI(tp);
+ (void) chSchReadyI(tp);
}
}
diff --git a/os/rt/src/chtm.c b/os/rt/src/chtm.c
index 9d95bd987..07f365114 100644
--- a/os/rt/src/chtm.c
+++ b/os/rt/src/chtm.c
@@ -28,7 +28,7 @@
#include "ch.h"
-#if CH_CFG_USE_TM || defined(__DOXYGEN__)
+#if (CH_CFG_USE_TM == TRUE) || defined(__DOXYGEN__)
/*===========================================================================*/
/* Module local definitions. */
@@ -55,14 +55,16 @@ static inline void tm_stop(time_measurement_t *tmp,
rtcnt_t offset) {
tmp->n++;
- tmp->last = now - tmp->last - offset;
+ tmp->last = (now - tmp->last) - offset;
tmp->cumulative += (rttime_t)tmp->last;
+ /*lint -save -e9013 [15.7] There is no else because it is not needed.*/
if (tmp->last > tmp->worst) {
tmp->worst = tmp->last;
}
else if (tmp->last < tmp->best) {
tmp->best = tmp->last;
}
+ /*lint -restore*/
}
/*===========================================================================*/
@@ -151,6 +153,6 @@ NOINLINE void chTMChainMeasurementToX(time_measurement_t *tmp1,
tm_stop(tmp1, tmp2->last, 0);
}
-#endif /* CH_CFG_USE_TM */
+#endif /* CH_CFG_USE_TM == TRUE */
/** @} */
diff --git a/os/rt/src/chvt.c b/os/rt/src/chvt.c
index 68ef9b861..de50a4ae5 100644
--- a/os/rt/src/chvt.c
+++ b/os/rt/src/chvt.c
@@ -60,7 +60,10 @@
*/
void _vt_init(void) {
- ch.vtlist.vt_next = ch.vtlist.vt_prev = (void *)&ch.vtlist;
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
+ ch.vtlist.vt_next = (virtual_timer_t *)&ch.vtlist;
+ ch.vtlist.vt_prev = (virtual_timer_t *)&ch.vtlist;
+ /*lint -restore*/
ch.vtlist.vt_delta = (systime_t)-1;
#if CH_CFG_ST_TIMEDELTA == 0
ch.vtlist.vt_systime = 0;
@@ -102,17 +105,19 @@ void chVTDoSetI(virtual_timer_t *vtp, systime_t delay,
vtp->vt_func = vtfunc;
p = ch.vtlist.vt_next;
-#if CH_CFG_ST_TIMEDELTA > 0 || defined(__DOXYGEN__)
+#if (CH_CFG_ST_TIMEDELTA > 0) || defined(__DOXYGEN__)
{
systime_t now = port_timer_get_time();
/* If the requested delay is lower than the minimum safe delta then it
is raised to the minimum safe value.*/
- if (delay < CH_CFG_ST_TIMEDELTA) {
- delay = CH_CFG_ST_TIMEDELTA;
+ if (delay < (systime_t)CH_CFG_ST_TIMEDELTA) {
+ delay = (systime_t)CH_CFG_ST_TIMEDELTA;
}
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
if (&ch.vtlist == (virtual_timers_list_t *)p) {
+ /*lint -restore*/
/* The delta list is empty, the current time becomes the new
delta list base time.*/
ch.vtlist.vt_lasttime = now;
@@ -140,8 +145,10 @@ void chVTDoSetI(virtual_timer_t *vtp, systime_t delay,
}
/* The timer is inserted in the delta list.*/
- vtp->vt_prev = (vtp->vt_next = p)->vt_prev;
- vtp->vt_prev->vt_next = p->vt_prev = vtp;
+ vtp->vt_next = p;
+ vtp->vt_prev = vtp->vt_next->vt_prev;
+ vtp->vt_prev->vt_next = vtp;
+ p->vt_prev = vtp;
vtp->vt_delta = delay
/* Special case when the timer is in last position in the list, the
@@ -168,28 +175,30 @@ void chVTDoResetI(virtual_timer_t *vtp) {
vtp->vt_next->vt_delta += vtp->vt_delta;
vtp->vt_prev->vt_next = vtp->vt_next;
vtp->vt_next->vt_prev = vtp->vt_prev;
- vtp->vt_func = (vtfunc_t)NULL;
+ vtp->vt_func = NULL;
/* The above code changes the value in the header when the removed element
is the last of the list, restoring it.*/
ch.vtlist.vt_delta = (systime_t)-1;
-#if CH_CFG_ST_TIMEDELTA > 0 || defined(__DOXYGEN__)
+#if (CH_CFG_ST_TIMEDELTA > 0) || defined(__DOXYGEN__)
{
+ /*lint -save -e9087 -e740 [11.3, 1.3] Cast required by list handling.*/
if (&ch.vtlist == (virtual_timers_list_t *)ch.vtlist.vt_next) {
+ /*lint -restore*/
/* Just removed the last element in the list, alarm timer stopped.*/
port_timer_stop_alarm();
}
else {
/* Updating the alarm to the next deadline, deadline that must not be
closer in time than the minimum time delta.*/
- if (ch.vtlist.vt_next->vt_delta >= CH_CFG_ST_TIMEDELTA) {
+ if (ch.vtlist.vt_next->vt_delta >= (systime_t)CH_CFG_ST_TIMEDELTA) {
port_timer_set_alarm(ch.vtlist.vt_lasttime +
ch.vtlist.vt_next->vt_delta);
}
else {
port_timer_set_alarm(ch.vtlist.vt_lasttime +
- CH_CFG_ST_TIMEDELTA);
+ (systime_t)CH_CFG_ST_TIMEDELTA);
}
}
}