A typedef names a pointer to an object type, hiding the pointer
What it finds
typedef struct node *node_ref;: the name hides that values of the type are pointers, so const node_ref makes the pointer constant rather than the node, and copies and frees are hard to see. Typedefs of function pointers are left alone.
From the rule's source, typedef_hides_pointer.rs.
struct node { int value; };typedef struct node *node_ref;tx0 reports: the type node_ref hides that it is a pointertypedef int (*compare_fn)(const void *, const void *);typedef struct node node_t; 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/c:typedef-hides-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/c:typedef-hides-pointer] reason="..."tx0 explain tx0/c:typedef-hides-pointer shows the same in the terminal. Found a false positive? Report it.