AutosarC++17_03-A5.0.2¶
The condition of an if-statement and the condition of an iteration statement shall have type bool
Required inputs: IR
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
nonbool_if_condition |
Condition must have type bool |
None |
False |
nonbool_logical_operator_operand |
Sub-condition must have type bool |
None |
False |
nonbool_loop_condition |
Condition must have type bool |
None |
False |
Options¶
This rule shares the following common options: exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
only_in_conditions¶
only_in_conditions : bool = True
only_pointer_types¶
only_pointer_types : bool = False
report_do_while_false¶
report_do_while_false : bool = True
do ... while(0) should be reported.
report_while_true¶
report_while_true : bool = True
while(1) ... should be reported.