SecureCoding-5.10¶
Converting a pointer to integer or integer to pointer
Required inputs: IR
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
cast_changes_type_category |
Conversion between pointer type and integer type |
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
allow_pointer_to_integer¶
allow_pointer_to_integer : bool = False
allow_volatile_pointer_from_integer_literal¶
allow_volatile_pointer_from_integer_literal : bool = False
(volatile uint8_t*)0xABCD
Such casts are often used for memory mapped I/O.
category_changes¶
category_changes
List of (from, to) type category pairs to check for. Both from and to are sets of categories.Type: list[typing.Tuple[typing.Set[bauhaus.ir.common.types.type_systems.TypeCategory], typing.Set[bauhaus.ir.common.types.type_systems.TypeCategory]]]
Default:
[({'enum_types', 'signed_types', 'unsigned_types'}, {'object_pointer_types'}), ({'object_pointer_types'}, {'enum_types', 'signed_types', 'unsigned_types'}), ({'bool_types'}, {'object_pointer_types'}), ({'object_pointer_types'}, {'bool_types'}), ({'char_types'}, {'object_pointer_types'}), ({'object_pointer_types'}, {'char_types'})]
check_explicit_casts¶
check_explicit_casts : bool = True
check_implicit_casts¶
check_implicit_casts : bool = False
look_through_casts¶
look_through_casts : bool = False
only_complex_expressions¶
only_complex_expressions : bool = False
show_operand_in_entity¶
show_operand_in_entity : bool = False
type_system¶
type_system : bauhaus.ir.common.types.type_systems.TypeSystem = <bauhaus.ir.common.types.type_systems.CompilerTypeSystem object at 0x7f6f1c5fd510>
Option Types¶
These types are used by options listed above:
TypeCategory¶
Base class for the different type categories.signed_types
unsigned_types
float_types
char_types
plain char.bool_types
bool, _Bool and special expressions.enum_types
void_types
void_pointer_types
incomplete_pointer_types
function_pointer_types
object_pointer_types
null_pointer_types
other_types
Those not covered by other categories.