3 ms·
> I'm surprised any seasoned C developer would make this mistake. Not everyone gets the talk. And even for the ones that do, many consider it to be useless nit
by saagarjha 7y ago
> I'm surprised any seasoned C developer would make this mistake.
Not everyone gets the talk. And even for the ones that do, many consider it to be useless nitpicking until it bites them. (And some who are bitten would prefer to yell at the compiler for “breaking their code”…)
> A is char or unsigned char, and the pointer was previously cast from a pointer to type B.
And if A is void, of course.
- gpderetta 7y ago> And if A is void, of course To nitpick, casting is rarely the issue. Dereferencing a pointer to the wrong type is the issue. As void can't never be dereferenced nor can be a valid underlying type, void never factors in alias analysis.