Forgot to reply to the list, my to original Carnsten response below: On Dec 10, 2007 5:32 PM, Carsten Sørensen <[EMAIL PROTECTED]> wrote: > 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 >
Hm, I remember something like that, yes. Makes sense. Ah well, that means I will have to find a portable version of XTEA code. I wish I could be angry at someone, but the only ones that are "bad" here are ARM designers, and I can't really do anything about them ;) -- Ivan Vučica -- Croatia -- ------------------------------------------------------------------------- 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