qpc/ports/lint-plus/au-misra3-amd1.lnt

262 lines
9.9 KiB
Plaintext
Raw Normal View History

2019-12-31 15:55:08 -05:00
// ---------------------------------------------------------------------------
// Copyright Gimpel Software LLC 2019. All rights reserved.
//
// This file is provided by Gimpel Software LLC (https://www.gimpel.com) for
// use with PC-lint Plus. Redistribution is permitted but any redistribution
// must preserve this notice and, if the redistributed file has been modified,
// provide notice that the file has been modified from the original.
// ---------------------------------------------------------------------------
// au-misra3-amd1.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:
lint au-misra3-amd1.lnt hello.c
Gimpel Software relies on the document, "MISRA C:2012 Amendment 1
Additional security guidelines for MISRA C:2012"
copyright 2016 by HORIBA MIRA Ltd, 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 HORIBA MIRA Ltd, held on
behalf of the MISRA Consortium.
*/
/* version check */ -cond('%PCLP_NO_LNT_VERSION_CHECK%' != '1' && (%LINT_MAJOR_VERSION% != 1 || %LINT_MINOR_VERSION% != 3),
+fatal_error(This configuration file is intended for PC-lint Plus 1.3.
You are attempting to use it with PC-lint Plus %LINT_MAJOR_VERSION%.%LINT_MINOR_VERSION%.
It is recommended that you use configuration files intended
for PC-lint Plus %LINT_MAJOR_VERSION%.%LINT_MINOR_VERSION%.)
)
/**** Dir 4.14 (Req) ************/
/* Not currently supported */
/**** Rule 12.5 (Mand) ************/
+e682 /* sizeof applied to parameter whose type is sized array */
+elib(682)
-append(682,[MISRA 2012 Rule 12.5, mandatory])
+e882 /* sizeof applied to parameter declared as incomplete array */
+elib(882)
-append(882,[MISRA 2012 Rule 12.5, mandatory])
/**** Rule 21.13 (Mand) ************/
/* While MISRA has declared this rule to be "undecidable", Gimpel
* Software provides the following options to assist:
*/
/* Define EOF until a proper definition is seen */
-dEOF=-1
/* Define UCHAR_MIN and UCHAR_MAX if no definition available */
-dUCHAR_MIN=0
-dUCHAR_MAX=255
/* Ensure macro versions of ctype.h functions expand to function versions
to make use of the function semantics defined below */
2020-04-02 21:21:11 -04:00
--uisalnum
--uisalpha
--uisblank
--uiscntrl
--uisdigit
--uisgraph
--uislower
--uisprint
--uispunct
--uisspace
--uisupper
--uisxdigit
--utolower
--utoupper
2019-12-31 15:55:08 -05:00
/* Define semantics for ctype.h functions */
-sem(isalnum, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isalpha, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isblank, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(iscntrl, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isdigit, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isgraph, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(islower, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isprint, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(ispunct, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isspace, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isupper, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(isxdigit, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(tolower, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
-sem(toupper, (1n >= UCHAR_MIN && 1n <= UCHAR_MAX) || 1n == EOF)
+esym(426, isalnum)
+esym(426, isalpha)
+esym(426, isblank)
+esym(426, iscntrl)
+esym(426, isdigit)
+esym(426, isgraph)
+esym(426, islower)
+esym(426, isprint)
+esym(426, ispunct)
+esym(426, isspace)
+esym(426, isupper)
+esym(426, isxdigit)
+esym(426, tolower)
+esym(426, toupper)
-append(426(isalnum), value passed to isalnum is not representable as unsigned char and is not EOF)
-append(426(isalnum),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isalpha), value passed to isalpha is not representable as unsigned char and is not EOF)
-append(426(isalpha),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isblank), value passed to isblank is not representable as unsigned char and is not EOF)
-append(426(isblank),[MISRA 2012 Rule 21.13, mandatory])
-append(426(iscntrl), value passed to iscntrl is not representable as unsigned char and is not EOF)
-append(426(iscntrl),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isdigit), value passed to isdigit is not representable as unsigned char and is not EOF)
-append(426(isdigit),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isgraph), value passed to isgraph is not representable as unsigned char and is not EOF)
-append(426(isgraph),[MISRA 2012 Rule 21.13, mandatory])
-append(426(islower), value passed to islower is not representable as unsigned char and is not EOF)
-append(426(islower),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isprint), value passed to isprint is not representable as unsigned char and is not EOF)
-append(426(isprint),[MISRA 2012 Rule 21.13, mandatory])
-append(426(ispunct), value passed to ispunct is not representable as unsigned char and is not EOF)
-append(426(ispunct),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isspace), value passed to isspace is not representable as unsigned char and is not EOF)
-append(426(isspace),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isupper), value passed to isupper is not representable as unsigned char and is not EOF)
-append(426(isupper),[MISRA 2012 Rule 21.13, mandatory])
-append(426(isxdigit), value passed to isxdigit is not representable as unsigned char and is not EOF)
-append(426(isxdigit),[MISRA 2012 Rule 21.13, mandatory])
-append(426(tolower), value passed to tolower is not representable as unsigned char and is not EOF)
-append(426(tolower),[MISRA 2012 Rule 21.13, mandatory])
-append(426(toupper), value passed to toupper is not representable as unsigned char and is not EOF)
-append(426(toupper),[MISRA 2012 Rule 21.13, mandatory])
/**** Rule 21.14 (Req) ************/
/* Not currently supported */
/**** Rule 21.15 (Req) ************/
+e857 /* incompatible pointer arguments to memcpy/memmove/memcmp */
+elib(857)
-append(857,[MISRA 2012 Rule 21.15, required])
/**** Rule 21.16 (Req) ************/
+e9098 /* pointer argument to memcmp does not point to a pointer type
or an essentially signed, unsigned, boolean, or enum type */
+elib(9098)
-append(9098,[MISRA 2012 Rule 21.16, required])
/**** Rule 21.17 (Mand) ************/
/* While MISRA has declared this rule to be "undecidable", Gimpel
* Software provides the following options to assist:
*/
/* 419 - apparent data overrun for function */
/* 420 - apparent access beyond array for function */
+esym(419 420, strcat, strcpy)
-append(419(strcat),[MISRA 2012 Rule 21.17, mandatory])
-append(420(strcat),[MISRA 2012 Rule 21.17, mandatory])
-append(419(strcpy),[MISRA 2012 Rule 21.17, mandatory])
-append(420(strcpy),[MISRA 2012 Rule 21.17, mandatory])
/**** Rule 21.18 (Mand) ************/
/* While MISRA has declared this rule to be "undecidable", Gimpel
* Software provides the following options to assist:
*/
/* 419 - apparent data overrun for function */
/* 420 - apparent access beyond array for function */
/* 422 - function passed a negative value */
+esym(419 420 422, memchr, memcmp, memcpy, memmove, memset)
+esym(419 420 422, strncat, strncmp, strncpy, strxfrm)
/* PC-lint Plus will issue 419 when it can determine that
* the size parameter of the below functions exceeds the
* size of the buffer that is being written to.
*/
-append(419(memcpy),[MISRA 2012 Rule 21.18, mandatory])
-append(419(memmove),[MISRA 2012 Rule 21.18, mandatory])
-append(419(strncat),[MISRA 2012 Rule 21.18, mandatory])
-append(419(strncpy),[MISRA 2012 Rule 21.18, mandatory])
/* PC-lint Plus will issue 420 when it can determine that
* the size parameter of the below functions exceeds the
* size of the buffer that is being read from.
*/
-append(420(memchr),[MISRA 2012 Rule 21.18, mandatory])
-append(420(memcmp),[MISRA 2012 Rule 21.18, mandatory])
-append(420(memcpy),[MISRA 2012 Rule 21.18, mandatory])
-append(420(memmove),[MISRA 2012 Rule 21.18, mandatory])
/* PC-lint Plus will issue 422 when it can determine that
* a negative value is being passed to the size parameter
* of the below functions.
*/
-append(422(memchr),[MISRA 2012 Rule 21.18, mandatory])
-append(422(memcmp),[MISRA 2012 Rule 21.18, mandatory])
-append(422(memcpy),[MISRA 2012 Rule 21.18, mandatory])
-append(422(memmove),[MISRA 2012 Rule 21.18, mandatory])
-append(422(memset),[MISRA 2012 Rule 21.18, mandatory])
-append(422(strncat),[MISRA 2012 Rule 21.18, mandatory])
-append(422(strncmp),[MISRA 2012 Rule 21.18, mandatory])
-append(422(strncpy),[MISRA 2012 Rule 21.18, mandatory])
-append(422(strxfrm),[MISRA 2012 Rule 21.18, mandatory])
/**** Rule 21.19 (Mand) ************/
/* Not currently supported */
/**** Rule 21.20 (Mand) ************/
/* Not currently supported */
/**** Rule 22.7 (Req) ************/
/* Not currently supported */
/**** Rule 22.8 (Req) ************/
/* Not currently supported */
/**** Rule 22.9 (Req) ************/
/* Not currently supported */
/**** Rule 22.10 (Req) ************/
/* Not currently supported */