AutosarC++18_03-A3.3.2¶
Static and thread-local objects shall be constant-initialized
Required inputs: IR
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
constexpr_init_variable |
Static and thread-local objects shall be constant-initialized. |
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
allowed_effects¶
allowed_effects
If set, static and thread-local objects may also be initialized with a non-constexpr function/constructor call that only has the specified side-effects. If set, a writing side-effect to the object in question will be allowed additionally.Type: set[SimpleEffect] | None
Default:
None
Option Types¶
These types are used by options listed above:
SimpleEffect¶
This enum is a simplified representation of the effects. It's used by stylecheck rules as `Set[SimpleEffect]` to allow the user to configure additional allowed effects.alloc_free
Memory allocations (malloc, free, new, delete).volatile
Accessing volatile memory.atomic
Atomic access; also used for inter-thread memory barriers.unknown_code
The "Unknown Code" effect appears when calling a function that has no definition in the IR.exceptions
Throwing C++ exceptions.optimizer_hint
Optimizer hints without semantic effect. Examples are '__builtin_assume' or '__builtin_unreachable'.