Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Microsoft Visual Studio 2013 issues no warnings about this code, even at the highest diagnostic levels.

The GCC compiler generates a fatal diagnostic GCC and Clang 14 both generate fatal diagnostics for the conflicting definitions of i2 and i5.

...

Tool

Version

Checker

Description

Astrée
Include Page
Astrée_V
Astrée_V

static-function-declaration

static-object-declaration

Partially checked
Axivion Bauhaus Suite

Include Page
Axivion Bauhaus Suite_V
Axivion Bauhaus Suite_V

CertC-DCL36Fully implemented
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V

LANG.STRUCT.DECL.NOEXT

Missing External Declaration

Coverity
Include Page
Coverity_V
Coverity_V
PW.LINKAGE_CONFLICTImplemented

ECLAIR

Include Page
ECLAIR_V
ECLAIR_V

CC2.DCL36

Fully implemented

GCC
Include Page
GCC_V
GCC_V



Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

C0625Fully implemented
Klocwork
Include Page
Klocwork_V
Klocwork_V

MISRA.FUNC.STATIC.REDECL

Fully implemented

LDRA tool suite
Include Page
LDRA_V
LDRA_V

461 S, 575 S, 2 X

Fully implemented

PC-lint Plus

Include Page
PC-lint Plus_V
PC-lint Plus_V

401, 839, 1051

Fully supported

Splint
Include Page
Splint_V
Splint_V



Parasoft C/C++test
Include Page
Parasoft_V
Parasoft_V
CERT_C-DCL36-a
Identifiers shall not simultaneously have both internal and external linkage in the same translation unit
Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

MISRA CERT C: 2012 Rule 8.2

MISRA C:2012 Rule 8.4

MISRA C:2012 Rule 8.8

MISRA C:2012 Rule 17.3

Function types shall be in prototype form with named parameters

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

The static storage class specifier shall be used in all declarations of objects and functions that have internal linkage

A function shall not be declared implicitly

PRQA QA-C
Include Page
PRQA QA-C_vPRQA QA-C_v

Rule DCL36-C


Checks for inconsistent use of static and extern in object declarations (rule partially covered)

0625 (U)Fully implementedRuleChecker

Include Page
RuleChecker_V
RuleChecker_V

static-function-declaration

static-object-declaration
Partially checked
TrustInSoft Analyzer

Include Page
TrustInSoft Analyzer_V
TrustInSoft Analyzer_V

non-static declaration follows static declaration

Partially verified.

Related Vulnerabilities

Search for vulnerabilities resulting from the violation of this rule on the CERT website.

Related Guidelines

Key here (explains table format and definitions)

...