Bruno Haible wrote:
Matthew,
The citation in
http://lists.gnu.org/archive/html/bug-coreutils/2006-10/msg00062.html
looks like it explains why no 'long long' type exists although the machine
would support it. Are you sure the machine supports '[signed] long long'?
Before we engage on a change as large as this, can you please report
the results (output) of the attached program, compiled once with and once
without optimization?
If it doesn't compile, try commenting out one of the lines
#define HAVE_LONGLONG 1
#define HAVE_ULONGLONG 1
As should be expected, I had to take out HAVE_ULONGLONG for it to
compile. I also had to take out several of the comments (non-ASCII
characters were doing Bad Things).
If I am reading this correctly, 'long long' is OK (64-bit), which is a
bit of a relief since one of our products demands an int8(!). The errors
about sign extension were interesting, though.
I'm attaching the non-optimized output. The optimized ('cc -O') output
is identical, plus these two errors:
#error "Left shift of integers of type long long does not work!!"
#error "Right shift of integers of type long long does not work!!"
--
Matthew
Will your shell have salvation? Only if it's Bourne Again.
/* Integers of type char have 8 bits. */
#define char_bitsize 8
/* Integers of type short have 16 bits. */
#define short_bitsize 16
/* Integers of type int have 32 bits. */
#define int_bitsize 32
/* Integers of type long have 32 bits. */
#define long_bitsize 32
/* Integers of type long long have 64 bits. */
#define long_long_bitsize 64
/* Integers of type unsigned char have 8 bits. */
/* Integers of type unsigned short have 16 bits. */
/* Integers of type unsigned int have 32 bits. */
/* Integers of type unsigned long have 32 bits. */
/* Integer types char and unsigned char have the same binary representation. */
/* Integer types short and unsigned short have the same binary representation.
*/
/* Integer types int and unsigned int have the same binary representation. */
/* Integer types long and unsigned long have the same binary representation. */
#error "Right shift of integers of type char does not work!!"
#error "Casts from char to short works by zero-extend!!"
#error "Casts from char to int works by zero-extend!!"
#error "Casts from char to long works by zero-extend!!"
#error "Casts from char to long long works by zero-extend!!"
#error "Casts from char to unsigned short works by zero-extend!!"
#error "Casts from char to unsigned int works by zero-extend!!"
#error "Casts from char to unsigned long works by zero-extend!!"
/* Pointers of type char * have 32 bits. */
#define pointer_bitsize 32
/* Casts from long * to char * is OK (does nothing). */
/* Casts from char * to long * is OK (does nothing). */
/* Casts from function * to char * is OK (does nothing). */
/* Casts from char * to function * is OK (does nothing). */
/* Type char has sizeof = 1 and alignment = 1. */
#define sizeof_char 1
#define alignment_char 1
/* Type unsigned char has sizeof = 1 and alignment = 1. */
/* Type short has sizeof = 2 and alignment = 2. */
#define sizeof_short 2
#define alignment_short 2
/* Type unsigned short has sizeof = 2 and alignment = 2. */
/* Type int has sizeof = 4 and alignment = 4. */
#define sizeof_int 4
#define alignment_int 4
/* Type unsigned int has sizeof = 4 and alignment = 4. */
/* Type long has sizeof = 4 and alignment = 4. */
#define sizeof_long 4
#define alignment_long 4
/* Type unsigned long has sizeof = 4 and alignment = 4. */
/* Type long long has sizeof = 8 and alignment = 8. */
#define sizeof_long_long 8
#define alignment_long_long 8
/* Type float has sizeof = 4 and alignment = 4. */
#define sizeof_float 4
#define alignment_float 4
/* Type double has sizeof = 8 and alignment = 8. */
#define sizeof_double 8
#define alignment_double 8
/* Type char * has sizeof = 4 and alignment = 4. */
/* Type long * has sizeof = 4 and alignment = 4. */
/* Type function * has sizeof = 4 and alignment = 4. */
/* Type unsigned short is stored BIG-ENDIAN in memory (i.e. like mc68000 or
sparc). */
#define short_big_endian
/* Type unsigned int is stored BIG-ENDIAN in memory (i.e. like mc68000 or
sparc). */
#define int_big_endian
/* Type unsigned long is stored BIG-ENDIAN in memory (i.e. like mc68000 or
sparc). */
#define long_big_endian
/* Stack grows down, ca. 32 bytes per function call. */
#define stack_grows_down
_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils