On Dec 10, 2007 2:28 PM, Ivan Vucica <[EMAIL PROTECTED]> wrote: > Casting a char* into uint32_t*, unsigned int* or int* and then using it > with operator [] in both GCC and G++ crashes the application.
This is not a compiler bug. When accessing 32 bit values like an int on a RISC CPU like the ARM, the pointer has to be 32 bit aligned. The problem is the original source code is not written in a portable way. There's absolutely no guarantee that your char* will be 32 bit aligned after casting it to int* or similar and the result is undefined. Kind regards, Carsten Sorensen ------------------------------------------------------------------------- SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php _______________________________________________ Cegcc-devel mailing list Cegcc-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/cegcc-devel