01-10-2015, 06:48 PM
Within our development group, there has been some discussion as to whether or not the construction
is valid with regard to the usage of '!' against a pointer. According to the 18.X rules, '!' is not disallowed for use on pointers, but the explanation of Rule 10.1 with regards to the appropriate essential type for use with '!' would indicate that, as a non-Boolean, its use on pointers should be disallowed.
Do pointers have an "essential type" under the essential type model and what is the correct interpretation in this case?
Code:
void test(uint8_t * up)
{
bool invalid = !up;
...
}
Do pointers have an "essential type" under the essential type model and what is the correct interpretation in this case?
<t></t>