building for sandbox, warning: "__BIG_ENDIAN" is not defined

Robert P. J. Day rpjday at crashcourse.ca
Tue Dec 22 15:56:55 EST 2009


  perhaps showing my ignorance of how big vs little endian should be
implemented, but in configuring and building the sandbox version, i
get:

...
  CC      common/environment.o
In file included from common/environment.c:37:
include/envfs.h:47:23: warning: "__BIG_ENDIAN" is not defined
...

  this isn't surprising since, as i read it, because this is x86_64,
it's the little-endian headers that are included, but the envfs.h
header contains the preprocessor checking:

#ifndef __BYTE_ORDER
#error "No byte order defined in __BYTE_ORDER"
#endif

#if __BYTE_ORDER == __LITTLE_ENDIAN
... snip ...
#elif __BYTE_ORDER == __BIG_ENDIAN
... snip ...

  clearly(?), depending on which endianness is being used, one or the
other of __LITTLE_ENDIAN or __BIG_ENDIAN won't be defined, right?  so,
no matter what, *one* of those tests is going to generate a warning.

  am i reading that correctly?  is there a proper way to handle
endianness that doesn't generate a preprocessor warning?  thanks.

rday
--

========================================================================
Robert P. J. Day                               Waterloo, Ontario, CANADA

            Linux Consulting, Training and Kernel Pedantry.

Web page:                                          http://crashcourse.ca
Twitter:                                       http://twitter.com/rpjday
========================================================================



More information about the barebox mailing list