alias question

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

 



If I have a char array, and it's always written by the char array, can it be always reliably read by any combination of short/int/long pointers?

As I understand, the compiler will see byte writes for all types, so readind shoulg be fine without violating any strict alias rules.  Just can't write the array by any other type than char[] access.  Right?

char buf[8];
... alter buf[] ...
((short*)buf)[x];
((int*)buf)[y];
((long*)buf)[z];
... alter buf[] ...
((short*)buf)[x];
((int*)buf)[y];
((long*)buf)[z];

Thanks,
Jason Mancini



      


[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