This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: `__norestrict' type qualifier
According to Jamie Lokier:
> The C9X draft defines alignment already:
Marvy.
> I think this fixes every problem raised so far:
I agree. :-)
> For conversion to and from other pointer types, pointers of type
> `__norestrict B *', for all B, are subject to the same guarantees and
> restrictions as pointers of type `B *'. See 6.3.2.3 [#7].
>
> In particular, if the result of converting a pointer to `__norestrict B
> *' is not correctly aligned for the type B, the behaviour is undefined.
>
> Reading through a pointer of type `__norestrict B *' shall have the
> same, implementation-defined behaviour as converting the pointer to
> type `const char *', copying sizeof B characters from that address into
> field `a' of a temporary of type `union { char a [sizeof B]; B b; }',
> and then reading field `b'.
>
> Writing through a pointer of type `__norestrict B *' shall have the
> same, implementation-defined behaviour as writing to field `b' of a
> temporary of type `union { char a [sizeof B]; B b; }', converting the
> pointer to type `char *', and then copying sizeof B characters to that
> address from field `a'.
>
> The order of character copies is not defined -- they may occur
> simultaneously, independently or in any combination. A volatile
> qualification on B does not change this. A const qualification is
> honoured by disallowing writes in the usual way.
--
Chip Salzenberg - a.k.a. - <chip@perlsupport.com>
"When do you work?" "Whenever I'm not busy."