Linus Torvalds writes: (Summary) ((void*)((x) * 0l)) : (int*)1)))
Ok, so I can see that (void *)((x)*0l)) turns into NULL when x is an
ICE. NULL : (int *) 1)
sizeof( 1 ? NULL : (int *) 1)
and the rule is that if one of the sides of a ternary operation with pointers is NULL, the end result is the other type (int *). So yes, the above returns 'sizeof(int)'.
So yes, the above returns 'sizeof(int)'.
And if it is *not* an ICE that first pointer is still of type '(void *)', but it is not NULL.
*)', but it is not NULL.
And yes, the type conversion rules for a ternary op with two non-NULL pointers is different, and it now returns "void *".
sizeof( 1 ? NULL : (int *) 1)
and the rule is that if one of the sides of a ternary operation with pointers is NULL, the end result is the other type (int *). So yes, the above returns 'sizeof(int)'.
So yes, the above returns 'sizeof(int)'.
And if it is *not* an ICE that first pointer is still of type '(void *)', but it is not NULL.
*)', but it is not NULL.
And yes, the type conversion rules for a ternary op with two non-NULL pointers is different, and it now returns "void *".