A value is converted with a C-style cast, which may do a reinterpret_cast or remove const without saying so
What it finds
(T)x tries const_cast, static_cast and reinterpret_cast in turn, so a change of types elsewhere can turn a harmless conversion into a reinterpretation. The named casts say which conversion is meant. Casts to void, which discard a value, are left alone.
From the rule's source, c_style_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:
[rules]
"tx0/cpp:c-style-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:c-style-cast] reason="..."tx0 explain tx0/cpp:c-style-cast shows the same in the terminal. Found a false positive? Report it.