Versions Compared

Key

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

...

Failing to return a value from a code path in a value-returning function results in undefined behavior that might be exploited to cause data integrity violations.

Rule

Severity

Likelihood

Detectable

RepairableRemediation Cost

Priority

Level

MSC52-CPP

Medium

Probable

Yes

MediumNo

P8

L2

Automated Detection

C++2888SonarQube C/C++ PluginSonarQube C/C++ PluginSonarQube C/C++ PluginPRQA QA-C++PRQA QA-C++PRQA QA-C++PVS-StudioPVSStudioPVSStudioFully checked

Tool

Version

Checker

Description

Astrée

Include Page
Astrée_V
Astrée_V

return-implicit
Fully checked
Axivion Bauhaus Suite

Include Page
Axivion Bauhaus Suite_V
Axivion Bauhaus Suite_V

CertC++-MSC52
Clang
Include Page
Clang_V
Clang_V
-Wreturn-typeDoes not catch all instances of this rule, such as function-try-blocks
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V

LANG.STRUCT.MRS
LANG.STRUCT.NVNR

Missing return statement
Non-void noreturn,
Helix QAC

Include Page
Helix QAC_V
Helix QAC_V

DF2888
Klocwork
Include Page
Klocwork_V
Klocwork_V

FUNCRET.GEN

FUNCRET.IMPLICIT


LDRA tool suite
Include Page
LDRA_V
LDRA_V

2 D, 36 S

Fully implemented

Parasoft C/C++test
Include Page
Parasoft_V
Parasoft_V

CERT_CPP-MSC52-a

All exit paths from a function, except main(), with non-void return type shall have an explicit return statement with an expression

Polyspace Bug Finder

Include Page
Polyspace Bug Finder_V
Polyspace Bug Finder_V

CERT C++: MSC52-CPPChecks for missing return statements (rule partially covered)
PVS-Studio

Include Page

PVS-Studio_V

PVS-Studio_V

S935V591
RuleChecker
Include Page
RuleChecker_V
RuleChecker_V
1510return-implicit
Fully checked
Security Reviewer - Static Reviewer

Include Page

Security Reviewer -

Static Reviewer_V

Security Reviewer -

Static Reviewer_V

V591RuleChecker
Include Page
RuleChecker_VRuleChecker_Vreturn-implicit

RTOS_09
RTOS_10
RTOS_11
RTOS_12
Fully implemented
SonarQube C/C++ Plugin
Include Page
SonarQube C/C++ Plugin_V
SonarQube C/C++ Plugin_V
S935

Related Vulnerabilities

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

...