Miscellaneous-NoSignedDivisionΒΆ
Do not use signed variables in divisions
Required inputs: IR
Example
int i = 2; int j = 2/i; // bad int k = i/2; // bad unsigned u = 2; unsigned v = u/2; // ok unsigned w = 2/u; // ok
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
signed_division |
Division uses signed variable. |
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
This rule has no individual options.