23-09-2016, 03:45 PM
More concretely, is the following code a violation?
Code:
typedef void **my_t;
void f(my_t& x)
{
x = NULL;
}
<t></t>
Welcome to the new MISRA discussion forum, if you were previously a member of our forums you may need to reset your password.
Rule 5-0-19 are references also considered a 'pointer indirection'?
|
23-09-2016, 03:45 PM
More concretely, is the following code a violation?
Code: typedef void **my_t;
<t></t>
31-10-2016, 03:16 PM
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
Posted by and on behalf of
the MISRA C++ Working Group |
« Next Oldest | Next Newest »
|