A value is converted with reinterpret_cast, which reads its bits as another type

tx0/cpp:reinterpret-caststrictnotemaintainability/designdepth fastsmell

What it finds

reinterpret_cast reinterprets an object's representation; accessing the result as an unrelated type breaks the aliasing rules except for byte types. std::bit_cast copies the representation safely, and static_cast covers the conversions the language defines.

From the rule's source, reinterpret_cast.rs.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/cpp:reinterpret-cast" = "note"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/cpp:reinterpret-cast] reason="..."

tx0 explain tx0/cpp:reinterpret-cast shows the same in the terminal. Found a false positive? Report it.