This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] replace LIBGCC2_WORDS_BIG_ENDIAN with __WORDS_BIG_ENDIAN__


On Tue, Oct 12, 2010 at 04:48:39PM -0400, Nathan Froyd wrote:
> The patch below eliminates the need for LIBGCC2_WORDS_BIG_ENDIAN by
> having the compiler define __WORDS_BIG_ENDIAN__ and appropriate places
> use that instead.  The motivating idea here is that the compiler should
> be queried for all target-specific knowledge when compiling target
> libraries.  I plan to replace several other macros in a similar fashion.

Wouldn't it be better to define something like __BYTE_ORDER__
to 1234, 4321 or 3421 for little endian (WORDS+BYTES), big endian
(WORDS+BYTES) and PDP endian (see glibc's endian.h+bits/endian.h)?
That would avoid having to define also __BYTES_BIG_ENDIAN__ macro
and would be less misleading (seeing __WORDS_BIG_ENDIAN__ defined, albeit to
0, can be easily thought as that words are big endian rather than little
endian).

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]