A pointer to non-const char is made to point to a string literal

tx0/cpp:string-literal-pointerstrictwarningmaintainability/designdepth fastsmell

What it finds

char *name = "default";: the pointer lets code write into the literal, which is undefined. Declaring it const char * makes the compiler refuse such writes.

From the rule's source, string_literal_pointer.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:string-literal-pointer" = "warning"

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:string-literal-pointer] reason="..."

tx0 explain tx0/cpp:string-literal-pointer shows the same in the terminal. Found a false positive? Report it.