lundi 24 mars 2014

Strict aliasing rule: pointer to void vs. pointer to char and transitivity topic




On 2014-03-24, Xavier Roche <(E-Mail Removed)> wrote:
> Hi folks!
>
> My understanding of the aliasing rules is that a pointer to a char may
> alias any other pointer type.


This is necessary in order to tell a credible story about how uses of functions
like memcpy and memmove are well-defined ("they just are" not being a credible
story), and to allow such functions to be written in C.

> However, when using a pointer to void to transition to a pointer to a
> char, is the aliasing rule still unviolated ?


It doesn't matter how you the pointer to char is obtained, as long as every
step in the sequence of conversions is well-defined.





Aucun commentaire:

Enregistrer un commentaire