This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/50646] New: configure detects big endian on little endian system.
- From: "fzvqedi at v dot mintemail.com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 07 Oct 2011 01:30:23 +0000
- Subject: [Bug c/50646] New: configure detects big endian on little endian system.
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50646
Bug #: 50646
Summary: configure detects big endian on little endian system.
Classification: Unclassified
Product: gcc
Version: 4.5.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: fzvqedi@v.mintemail.com
checking whether byte ordering is bigendian... yes
| int
| main ()
| {
|
| /* Are we little or big endian? From Harbison&Steele. */
| union
| {
| long int l;
| char c[sizeof (long int)];
| } u;
| u.l = 1;
| return u.c[sizeof (long int) - 1] == 1;
|
| ;
| return 0;
| }
configure:8171: result:
yes
that test will return 0 on _little endian_
obviously the code was copypasted from a function isBigEndian(), but the author
forgot that returning 0 in main means success.
the reason it came so far is that configure dumbly added some stuff like
#define ssize_t int
to auto-host.h which caused all previous checks to err, because the libc just
typedef'd those types, resulting in:
error: two or more data types in declaration specifiers
or
error: 'long long long' is too long for GCC