On Thu, Oct 17, 2013 at 05:29:33PM +0200,
berenger.morel@neutralite.org wrote:
Speaking about endianness, it really is hard to manage:
void myfunction( ... )
{
#ifdef BIG_ENDIAN
move_bytes_in_a_specific_order
#else
move_bytes_in_the_other_specific_order
#endif
}
Bad way to manage endian in C. Better to have branching based on C
itself (rather than preprocessor), otherwise you run the risk of
never
testing code outside the branch your dev machine(s) match.
<snip>
Or similar. The test will likely be compiled out as a no-op anyway
with
decent compilers (GCC: yes; Sun Workshop: no.)