On 04/05/17 18:08, Jakub Jelinek wrote:
> On Wed, Apr 05, 2017 at 05:03:33PM +0100, Jonathan Wakely wrote:
>>> I wanted to say it behaves mostly like __attribute__((may_alias))
>>> except that may_alias only has an effect on pointers and references
>>> but not when accessing an object directly, (I hope you know what
>>> I mean).
>>
>> And may_alias is not a very helpful name either.
>>
>> I much prefer Richi's suggestion of typeless_storage.
>>
>> But I'm not convinced we need the attribute at all. If a struct
>> containing an array of std::byte or unsigned char has the property
>> already then that's good. I don't think we need a non-portable way to
>> make other types behave the same. If you can change the code to use a
>> new GCC attribute then you can change the code to use an array of
>> unsigned char, and be portable.
>
> It will only work that way in C++ though, so if you want to achieve
> the same in C, which doesn't have any special case for unsigned char
> arrays nor std::byte, you need an attribute.
>

Yes, exactly.  I really want to reach the deadline for gcc-7.
Fixing the name is certainly the most important first step,
and if everybody agrees on "typeless_storage", for the name
I can start with adjusting the name, and look into how
to use a spare type-flag that should be a mechanical change.


Bernd.

Reply via email to