[maemo-developers] [maemo-developers] automatic byte order check

From: Eero Tamminen eero.tamminen at movial.fi
Date: Thu Aug 24 10:23:18 EEST 2006

> I also tried to search for tools that could identify alignment problems
> automatically, but did not find anything useful. Probably the most easy 
> way to make such tool is to modify valgrind to track alignment for each
> memory access operation. But don't know, I ended up finding and fixing 
> such problems in my code manually without the help of any tools   :) 

GCC can help, at least to an extent. See "man gcc":
	Warn whenever a pointer is cast such that the required alignment
	of the target is increased.  For example, warn if a "char *" is
	cast to an "int *" on machines where integers can only be
	accessed at two- or four-byte boundaries.

	- Eero

More information about the maemo-developers mailing list