public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/50646] New: configure detects big endian on little endian system.
@ 2011-10-07  1:30 fzvqedi at v dot mintemail.com
  2011-10-07  8:40 ` [Bug c/50646] " rguenth at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: fzvqedi at v dot mintemail.com @ 2011-10-07  1:30 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-11-10 19:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-07  1:30 [Bug c/50646] New: configure detects big endian on little endian system fzvqedi at v dot mintemail.com
2011-10-07  8:40 ` [Bug c/50646] " rguenth at gcc dot gnu.org
2011-10-07 20:50 ` [Bug bootstrap/50646] " fzvqedi at v dot mintemail.com
2011-10-07 21:46 ` joseph at codesourcery dot com
2011-10-07 22:28 ` schwab@linux-m68k.org
2011-10-07 22:31 ` schwab@linux-m68k.org
2011-10-09 23:35 ` fzvqedi at v dot mintemail.com
2013-11-10 19:38 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).