-
Type:
Bug Detection
-
Status: Active
-
Resolution: Unresolved
-
Labels:
-
Default Severity:Major
-
Impact:Low
-
Likelihood:High
-
Default Quality Profiles:MISRA C++ 2008
-
Legacy Key:SideEffectInSizeOf
-
Covered Languages:C, C++, Objective-C
-
Remediation Function:Constant/Issue
-
Constant Cost:30min
This rule is a strict implementation of a MISRA (Motor Industry Software Reliability Association) rule. MISRA defines best practices for developing safety-critical software. You can learn more about this rule in the MISRA documents referenced below.
If you are not concerned with MISRA compliance or with safety-critical software, you might consider using rule S3135 instead ; it targets the same kind of issue for general-purpose software.
See
- MISRA C 2004, 12.3 - The sizeof operator shall not be used on expressions that contain side effects.
- MISRA C++ 2008, 5-3-4 - Evaluation of the operand to the sizeof operator shall not contain side effects.
- MISRA C 2012, 13.6 - The operand of the sizeof operator shall not contain any expression which has potential side effects
- is implemented by
-
CPP-156 Rule MISRA 5-3-4 : Evaluation of the operand to the sizeof operator shall not contain side effects.
-
- Closed
-
-
CPP-707 Create Objective-C rules repository containing targeted rules
-
- Closed
-
- relates to
-
RSPEC-3135 Valid arguments should be passed to "sizeof" and "alignof"
- Active
-
RSPEC-5279 Unevaluated operands should not have side effects
- Active
1.
|
C-Family | RSPEC-4390 |
|
Active | Unassigned |