Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 6 Next »

Generated Content

This page is automatically generated from the "Automated Detection" sections in the individual guidelines. Do not modify this page directly.

Version number:
v8.1

C checkers

Guideline

0160

MSC15-C. Do not depend on undefined behavior

0184

DCL10-C. Maintain the contract between the writer and caller of variadic functions

0185

DCL10-C. Maintain the contract between the writer and caller of variadic functions

0202

MSC14-C. Do not introduce unnecessary platform dependencies

0206 (U)

INT00-C. Understand the data model used by your implementation(s)

0272 (I)

INT08-C. Verify that all integer values are in range

0273 (I)

INT08-C. Verify that all integer values are in range

0309 (U)

INT11-C. Take care when converting from pointer to integer or integer to pointer

0310

EXP11-C. Do not apply operators expecting one type to data of an incompatible type

0310

EXP39-C. Do not access a variable through a pointer of an incompatible type

0311

EXP05-C. Do not cast away a const qualification

0312

EXP32-C. Do not access a volatile object through a non-volatile reference

0431(C)

DCL13-C. Declare function parameters that are pointers to values not changed by the function as const

0432 (C)

STR04-C. Use plain char for characters in the basic character set

0434 (C)

DCL31-C. Declare identifiers before using them

0487

ARR36-C. Do not subtract or compare two pointers that do not refer to the same array

0488

EXP08-C. Ensure pointer arithmetic is used correctly

0556

STR30-C. Do not attempt to modify string literals

0556

STR31-C. Guarantee that storage for strings has sufficient space for character data and the null terminator

0563

DCL07-C. Include the appropriate type information in function declarators

0625 (U)

DCL36-C. Do not declare an identifier with conflicting linkage classifications

0634 (I)

INT12-C. Do not make assumptions about the type of a plain int bit-field when used in an expression

0697

EXP03-C. Do not assume the size of a structure is the sum of the sizes of its members

0722

INT09-C. Ensure enumeration constants map to unique values

0723

INT09-C. Ensure enumeration constants map to unique values

0752

STR05-C. Use pointers to const when referring to string literals

0753

STR05-C. Use pointers to const when referring to string literals

0777(U)

DCL02-C. Use visually distinct identifiers

0777 (U)

DCL32-C. Guarantee that mutually visible identifiers are unique

0779 (U)

DCL32-C. Guarantee that mutually visible identifiers are unique

0883

PRE06-C. Enclose header files in an inclusion guard

1051

ARR32-C. Ensure size arguments for variable length arrays are in a valid range

1280

DCL16-C. Use 'L', not 'l', to indicate a long value

1302

DCL31-C. Declare identifiers before using them

1504

DCL15-C. Declare file-scope objects or functions that do not need external linkage as static

1505

DCL15-C. Declare file-scope objects or functions that do not need external linkage as static

1510

ARR31-C. Use consistent array notation across all source files

2050

DCL07-C. Include the appropriate type information in function declarators

2050

DCL31-C. Declare identifiers before using them

2051

DCL31-C. Declare identifiers before using them

2205

DCL04-C. Do not declare more than one variable per declaration

2547

DCL01-C. Do not reuse variable names in subscopes

2771

ARR36-C. Do not subtract or compare two pointers that do not refer to the same array

2814

EXP08-C. Ensure pointer arithmetic is used correctly

2930

EXP08-C. Ensure pointer arithmetic is used correctly

2931

ARR38-C. Guarantee that library functions do not form invalid pointers

3001

EXP37-C. Call functions with the arguments intended by the API

3103

INT10-C. Do not assume a positive remainder when using the % operator

3120

DCL06-C. Use meaningful symbolic constants to represent literal values

3120

EXP07-C. Do not diminish the benefits of constants by assuming their values in expressions

3121

DCL06-C. Use meaningful symbolic constants to represent literal values

3122

DCL06-C. Use meaningful symbolic constants to represent literal values

3123

DCL06-C. Use meaningful symbolic constants to represent literal values

3131

DCL06-C. Use meaningful symbolic constants to represent literal values

3132

DCL06-C. Use meaningful symbolic constants to represent literal values

3200

EXP12-C. Do not ignore values returned by functions

3204

DCL00-C. Const-qualify immutable objects

3217

DCL30-C. Declare objects with appropriate storage durations

3225

DCL30-C. Declare objects with appropriate storage durations

3227

DCL00-C. Const-qualify immutable objects

3230

DCL30-C. Declare objects with appropriate storage durations

3232

DCL00-C. Const-qualify immutable objects

3305

EXP36-C. Do not convert pointers into more strictly aligned pointer types

3305

EXP39-C. Do not access a variable through a pointer of an incompatible type

3307

EXP06-C. Operands to the sizeof operator should not contain side effects

3334

DCL01-C. Do not reuse variable names in subscopes

3335

DCL07-C. Include the appropriate type information in function declarators

3335

DCL31-C. Declare identifiers before using them

3340

FLP30-C. Do not use floating point variables as loop counters

3409

PRE02-C. Macro replacement lists should be parenthesized

3410

PRE01-C. Use parentheses within macros around parameter names

3412

PRE10-C. Wrap multi-statement macros in a do-while loop

3412

PRE11-C. Do not conclude macro definitions with a semicolon

3415

EXP02-C. Be aware of the short-circuit behavior of the logical AND and OR operators

3440

EXP31-C. Avoid side effects in assertions

3450

DCL07-C. Include the appropriate type information in function declarators

3453

PRE00-C. Prefer inline or static functions to function-like macros

3454

PRE31-C. Avoid side-effects in arguments to unsafe macros

3455

PRE31-C. Avoid side-effects in arguments to unsafe macros

3456

PRE31-C. Avoid side-effects in arguments to unsafe macros

3458

PRE10-C. Wrap multi-statement macros in a do-while loop

3601

PRE07-C. Avoid using repeated question marks

3673

DCL13-C. Declare function parameters that are pointers to values not changed by the function as const

3704

STR34-C. Cast characters to unsigned char before converting to larger integer sizes

4117

FLP33-C. Convert integers to floating point for floating point operations

4118

FLP33-C. Convert integers to floating point for floating point operations

4119

FLP33-C. Convert integers to floating point for floating point operations

4140

DCL30-C. Declare objects with appropriate storage durations

 

ARR02-C. Explicitly specify array bounds, even if implicitly defined by an initializer

 

ARR30-C. Do not form or use out of bounds pointers or array subscripts

 

ARR34-C. Ensure that array types in expressions are compatible

 

DCL03-C. Use a static assertion to test the value of a constant expression

 

DCL11-C. Understand the type issues associated with variadic functions

 

DCL34-C. Use volatile for data that cannot be cached

 

ENV03-C. Sanitize the environment when invoking external programs

 

ENV04-C. Do not call system() if you do not need a command processor

 

ENV31-C. Do not rely on an environment pointer following an operation that may invalidate it

 

EXP00-C. Use parentheses for precedence of operation

 

EXP10-C. Do not depend on the order of evaluation of subexpressions or the order in which side effects take place

 

EXP13-C. Treat relational and equality operators as if they were nonassociative

 

EXP30-C. Do not depend on order of evaluation between sequence points

 

EXP33-C. Do not reference uninitialized memory

 

EXP34-C. Do not dereference null pointers

 

FIO00-C. Take care when creating format strings

 

FIO01-C. Be careful using functions that use file names for identification

 

FIO03-C. Do not make assumptions about fopen() and file creation

 

FIO04-C. Detect and handle input and output errors

 

FIO06-C. Create files with appropriate access permissions

 

FIO07-C. Prefer fseek() to rewind()

 

FIO08-C. Take care when calling remove() on an open file

 

FIO10-C. Take care when using the rename() function

 

FIO12-C. Prefer setvbuf() to setbuf()

 

FIO43-C. Do not create temporary files in shared directories

 

FLP02-C. Avoid using floating point numbers when precise computation is needed

 

FLP03-C. Detect and handle floating point errors

 

FLP34-C. Ensure that floating point conversions are within range of the new type

 

INT02-C. Understand integer conversion rules

 

INT07-C. Use only explicitly signed or unsigned char type for numeric values

 

INT13-C. Use bitwise operators only on unsigned operands

 

INT30-C. Ensure that unsigned integer operations do not wrap

 

INT31-C. Ensure that integer conversions do not result in lost or misinterpreted data

 

INT32-C. Ensure that operations on signed integers do not result in overflow

 

INT33-C. Ensure that division and modulo operations do not result in divide-by-zero errors

 

INT34-C. Do not shift a negative number of bits or more bits than exist in the operand

 

INT35-C. Evaluate integer expressions in a larger size before comparing or assigning to that size

 

MEM02-C. Immediately cast the result of a memory allocation function call into a pointer to the allocated type

 

MEM03-C. Clear sensitive information stored in reusable resources

 

MEM05-C. Avoid large stack allocations

 

MSC00-C. Compile cleanly at high warning levels

 

MSC01-C. Strive for logical completeness

 

MSC02-C. Avoid errors of omission

 

MSC07-C. Detect and remove dead code

 

MSC09-C. Character Encoding - Use Subset of ASCII for Safety

 

MSC12-C. Detect and remove code that has no effect

 

MSC13-C. Detect and remove unused values

 

MSC30-C. Do not use the rand() function for generating pseudorandom numbers

 

MSC31-C. Ensure that return values are compared against the proper type

 

POS33-C. Do not use vfork()

 

POS34-C. Do not call putenv() with a pointer to an automatic variable as the argument

 

PRE03-C. Prefer typedefs to defines for encoding types

Secondary Analysis

DCL05-C. Use typedefs to improve code readability

Secondary analysis

PRE04-C. Do not reuse a standard header file name

Secondary Analysis

PRE08-C. Guarantee that header file names are unique

Secondary Analysis

PRE09-C. Do not replace secure functions with deprecated or obsolescent functions

 

SIG00-C. Mask signals handled by noninterruptible signal handlers

 

SIG01-C. Understand implementation-specific details regarding signal handler persistence

 

SIG34-C. Do not call signal() from within interruptible signal handlers

 

STR07-C. Use the bounds-checking interfaces for remediation of existing string manipulation code

 

STR35-C. Do not copy data from an unbounded source to a fixed-length array

 

STR36-C. Do not specify the bound of a character array initialized with a string literal

 

STR37-C. Arguments to character handling functions must be representable as an unsigned char

Warncall for scanf etc

INT05-C. Do not use input functions to convert character data if they cannot handle all possible inputs

Warncall -wc atoi, -wc atol

INT06-C. Use strtol() or a related function to convert a string token to an integer

  • No labels