rjmccall wrote:

> From all of above, the only way void* and char* alias if they are compatible, 
> but they are not:

Ah, you're right, I had misremembered this.  6.2.5p31 requires them to have the 
same representation as each other, and there's a footnote about this being 
meant to imply "interchangeability as arguments to functions, return values 
from functions, and members of unions", but it doesn't go so far as to make 
them formally compatible.  And even if we wanted to read that as implying a 
sort of semi-compatibility that ought to affect aliasing, the same paragraph 
goes on to say that all pointers to structs must have the same representation, 
and presumably we wouldn't want *that* to affect aliasing.

Alright, I withdraw that comment; it's not formally required.  We may need to 
be more conservative about the aliasing of `void*` l-values on practical 
grounds, but we can let that be informed by results on the ground.

https://github.com/llvm/llvm-project/pull/75177
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to