Miscellaneous-NoPrecisionLoss¶
Do not assign longer data types to shorter ones
Required inputs: IR
Example
short int_to_short(int i)
{
return i; // BAD
return (short)i; // OK
}
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
precision_loss |
{} with loss of precision. |
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
message_anchor¶
message_anchor
Allows to choose betweenType: dict[bauhaus.ir.PIR_Class_Name, AnchorKind]
Default:
{}
lhs, rhs, and
asgn (default) node as anchor where the message should be reported,
distinguished by PIR node type of the assignment kind.
Option Types¶
These types are used by options listed above:
AnchorKind¶
An enumeration.lhs
rhs
asgn