http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60490

--- Comment #5 from Chandler Carruth <chandlerc at gmail dot com> ---
(In reply to Eric Christopher from comment #4)
> I disagree for bare metal that including endian is the right way, but agree
> that __BYTE_ORDER__ is the right way to do this in general.
> 
> Thanks Jakub.

I don't really have a strong feeling about __BYTE_ORDER__ vs. other systems,
but it would be very nice if there were consistently available macros in both
GCC and Clang that could be used to detect endianness. If you don't like just
defining __BIG_ENDIAN__ and __LITTLE_ENDIAN__, could you suggest a concrete
pattern for __BYTE_ORDER__ which should be defined by the compiler on every
platform Jakub?

I'm particularly interested for the sake of bare metal or other freestanding
implementations which benefit from asking the compiler rather than a system
header.

Reply via email to