Enabled Services

directive MC4.D1.1 (required)

Any implementation-defined behaviour on which the output of the program depends shall be documented and understood

directive MC4.D4.1 (required)

Run-time failures shall be minimized

directive MC4.D4.2 (advisory)

All usage of assembly language should be documented

directive MC4.D4.3 (required)

Assembly language shall be encapsulated and isolated

directive MC4.D4.4 (advisory)

Sections of code should not be "commented out"

directive MC4.D4.5 (advisory)

Identifiers in the same name space with overlapping visibility should be typographically unambiguous

directive MC4.D4.6 (advisory)

typedefs that indicate size and signedness should be used in place of the basic numerical types

directive MC4.D4.8 (advisory)

If a pointer to a structure or union is never dereferenced within a translation unit, then the implementation of the object should be hidden

directive MC4.D4.9 (advisory)

A function should be used in preference to a function-like macro where they are interchangeable

directive MC4.D4.10 (required)

Precautions shall be taken in order to prevent the contents of a header file being included more than once

rule MC4.R1.1 (required)

The program shall contain no violations of the standard C syntax and constraints, and shall not exceed the implementation's translation limits

rule MC4.R1.3 (required)

There shall be no occurrence of undefined or critical unspecified behaviour

rule MC4.R1.5 (required)

Obsolescent language features shall not be used

rule MC4.R2.1 (required)

A project shall not contain unreachable code

rule MC4.R2.3 (advisory)

A project should not contain unused type declarations

rule MC4.R2.4 (advisory)

A project should not contain unused tag declarations

rule MC4.R2.5 (advisory)

A project should not contain unused macro definitions

rule MC4.R2.8 (advisory)

A project should not contain unused object definitions

rule MC4.R3.1 (required)

The character sequences `/*' and `//' shall not be used within a comment

rule MC4.R5.10 (required)

A reserved identifier or reserved macro name shall not be declared

rule MC4.R6.1 (required)

Bit-fields shall only be declared with an appropriate type

rule MC4.R7.2 (required)

A `u' or `U' suffix shall be applied to all integer constants that are represented in an unsigned type

rule MC4.R8.3 (required)

All declarations of an object or function shall use the same names and type qualifiers

rule MC4.R8.4 (required)

A compatible declaration shall be visible when an object or function with external linkage is defined

rule MC4.R8.5 (required)

An external object or function shall be declared once in one and only one file

rule MC4.R8.6 (required)

An identifier with external linkage shall have exactly one external definition

rule MC4.R8.7 (advisory)

Functions and objects should not be defined with external linkage if they are referenced in only one translation unit

rule MC4.R8.9 (advisory)

An object should be declared at block scope if its identifier only appears in a single function

rule MC4.R8.10 (required)

An inline function shall be declared with the `static' storage class

rule MC4.R8.11 (advisory)

When an array with external linkage is declared, its size should be explicitly specified

rule MC4.R8.13 (advisory)

A pointer should point to a `const'-qualified type whenever possible

rule MC4.R8.14 (required)

The `restrict' type qualifier shall not be used

rule MC4.R8.19 (advisory)

There shall be no external declarations in a source file

rule MC4.R9.1 (mandatory)

The value of an object with automatic storage duration shall not be read before it has been set

rule MC4.R10.1 (required)

Operands shall not be of an inappropriate essential type

rule MC4.R10.3 (required)

The value of an expression shall not be assigned to an object with a narrower essential type or of a different essential type category

rule MC4.R10.4 (required)

Both operands of an operator in which the usual arithmetic conversions are performed shall have the same essential type category

rule MC4.R10.7 (required)

If a composite expression is used as one operand of an operator in which the usual arithmetic conversions are performed then the other operand shall not have wider essential type

rule MC4.R10.8 (required)

The value of a composite expression shall not be cast to a different essential type category or a wider essential type

rule MC4.R11.1 (required)

Conversions shall not be performed between a pointer to a function and any other type

rule MC4.R11.3 (required)

A conversion shall not be performed between a pointer to object type and a pointer to a different object type

rule MC4.R11.4 (required)

A conversion shall not be performed between a pointer to object and an arithmetic type

rule MC4.R11.5 (advisory)

A conversion should not be performed from pointer to `void' into pointer to object

rule MC4.R11.8 (required)

A conversion shall not remove any `const', `volatile' or `_Atomic' qualification from the type pointed to by a pointer

rule MC4.R11.9 (required)

The macro `NULL' shall be the only permitted form of integer null pointer constant

rule MC4.R12.1 (advisory)

The precedence of operators within expressions should be made explicit

rule MC4.R12.2 (required)

The right hand operand of a shift operator shall lie in the range zero to one less than the width in bits of the essential type of the left hand operand

rule MC4.R12.3 (advisory)

The comma operator should not be used

rule MC4.R13.3 (advisory)

A full expression containing an increment (`++') or decrement (`--') operator should have no other potential side effects other than that caused by the increment or decrement operator

rule MC4.R13.5 (required)

The right hand operand of a logical `&&' or `||' operator shall not contain persistent side effects

rule MC4.R14.2 (required)

A `for' loop shall be well-formed

rule MC4.R14.3 (required)

Controlling expressions shall not be invariant

rule MC4.R14.4 (required)

The controlling expression of an `if' statement and the controlling expression of an iteration-statement shall have essentially Boolean type

rule MC4.R15.5 (disapplied)

A function should have a single point of exit at the end

rule MC4.R15.6 (required)

The body of an iteration-statement or a selection-statement shall be a compound-statement

rule MC4.R16.1 (required)

All `switch' statements shall be well-formed

rule MC4.R16.4 (required)

Every `switch' statement shall have a `default' label

rule MC4.R17.2 (required)

Functions shall not call themselves, either directly or indirectly

rule MC4.R17.7 (required)

The value returned by a function having non-void return type shall be used

rule MC4.R17.8 (advisory)

A function parameter should not be modified

rule MC4.R17.11 (advisory)

A function that never returns should be declared with a `_Noreturn' function specifier

rule MC4.R18.1 (required)

A pointer resulting from arithmetic on a pointer operand shall address an element of the same array as that pointer operand

rule MC4.R18.3 (required)

The relational operators `>', `>=', `<' and `<=' shall not be applied to expressions of pointer type except where they point into the same object

rule MC4.R18.4 (advisory)

The `+', `-', `+=' and `-=' operators should not be applied to an expression of pointer type

rule MC4.R19.2 (advisory)

The `union' keyword should not be used

rule MC4.R19.3 (required)

A `union' member shall not be read unless it has been previously set

rule MC4.R20.1 (advisory)

`#include' directives should only be preceded by preprocessor directives or comments

rule MC4.R20.5 (advisory)

`#undef' should not be used

rule MC4.R20.7 (required)

Expressions resulting from the expansion of macro parameters shall be enclosed in parentheses

rule MC4.R20.8 (required)

The controlling expression of a `#if' or `#elif' preprocessing directive shall evaluate to 0 or 1

rule MC4.R20.10 (advisory)

The `#' and `##' preprocessor operators should not be used

rule MC4.R20.13 (required)

A line whose first token is `#' shall be a valid preprocessing directive

rule MC4.R20.15 (required)

`#define' and `#undef' shall not be used on a reserved identifier or reserved macro name

tool B.EXPLAIN

Explain user configuration