'char **' <-> 'unsigned char **' and aliasing/punning in C / GNU C

Ian Lance Taylor iant@google.com
Fri Mar 8 22:18:00 GMT 2013


On 3/8/13, Pedro Alves <palves@redhat.com> wrote:
>
>> The answer to that
>> question is yes, because qualifiers are ignored when considering
>> aliasing.  That is, it is safe to cast from T* to unsigned T*.
>
> Ah, okay.  You got me a bit confused because signed/unsigned
> aren't called qualifiers though; those would be const/volatile,
> I think.

Sorry, you're quite right.  Signed and unsigned are ignored, and so
are qualifiers.

Ian



More information about the Gcc-help mailing list