MISRA Discussion Forums

Full Version: Rule 5-0-19 are references also considered a 'pointer indirection'?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
More concretely, is the following code a violation?

Code:
typedef void **my_t;

void f(my_t& x)
{
   x = NULL;
}
References are not a level of indirection.

The rule is trying to limit the complexity when accessing / understanding multiple levels of pointers - a reference simply creates an alias for an object and does not add any further levels of indirection