Integral type with sizeof(T) == 1 and distinct aliasing class

Florian Weimer fw@deneb.enyo.de
Fri May 25 20:01:00 GMT 2012


* Ian Lance Taylor:

> Florian Weimer <fw@deneb.enyo.de> writes:
>
>> Is there a type which is basically an (unsigned) char, but with the
>> additional feature that a pointer derived from it wouldn't alias with
>> basically anything?
>>
>> This type would be handy for optimizing marshaling code.
>
> There is no such type.  However, use of the restrict qualifier should
> achieve a similar effect.

It turns out that I can't get GCC to eliminate redundant bounds
checks, no matter what the type is.  I guess I have to do this in a
library after all, using template metaprogramming.



More information about the Gcc-help mailing list