Re: macros to detect endiannes?

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

 



Hi Kimmo,

GCC is a very good optimizing compiler.  A very, very good optimizing compiler.

Before you invest in making endian-aware subroutines, I strongly urge you to consider writing endian-agnostic routines.

And if code profiling IN THE OPTIMIZED CODE bears out that those routines need to be & can be made more efficient by being crafted as endian-aware routines, then-and-only-then take the next step by writing non-portable endian-aware code.

Even if the portability is subsumed by macro-triggers of endian-ness to preprocess-in the correct endian-aware code, that code is still less-than-portable.

Also the big-endian and little-endian code needs to be maintained in tandem.  That can be a source of problems, via code rot.

KISS is applicable in situations like these.  Tricky is not necessarily better.  Nor necessarily more efficient.

Sincerely,
--Eljay

More insights at <http://mindprod.com/unmain.html>. 


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux