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

Re: endianness (was Re: sysadmin qualifications (Re: apt-get vs. aptitude))





On 17 Oct 2013, at 17:47, berenger.morel@neutralite.org wrote:

I do not understand why?
In both cases with "decent compilers" it is solved at compile-time, so what is the problem with preprocessor here? In case BIG_ENDIAN is not defined but should be?

For the reason I wrote:

otherwise you run the risk of never
testing code outside the branch your dev machine(s) match.

Imagine you compile and test your code on a big endian machine 99% of the time. Imagine you make a mistake in the little-endian branch. With the cpp approach, the compiler won't see the buggy code. With the other approach, it will, and may catch the mistake.

Reply to: