Re: quick question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jim Stapleton wrote:

>   char test[] =  {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
> 0x08, 0x09, 0x0a};
>   char *tptr = test;
>   int *ptr;
> 
>   ptr = (int*)tptr;

Doesn't this violate the C aliasing rules?  If so the whole thing is
undefined behavior.

Brian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux