avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] inttypes.h cleanup for -mint8


From: Nils Kristian Strøm
Subject: Re: [avr-libc-dev] inttypes.h cleanup for -mint8
Date: Wed, 13 Nov 2002 00:24:10 +0100
User-agent: KMail/1.4.3

On Tuesday 12 November 2002 19:53, Joerg Wunsch wrote:
> As E. Weddington wrote:
> > My ideal:
> >
> > -mint8 mode:
> >   char          -> 8 bit
> >   int            -> 8 bit
> >   short        -> 16 bit
> >   long         -> 32 bit
> >   long long  -> 64 bit
>
> short must not be longer than int.  After all, it's named "short"
> which somehow suggests it is shorter than normal.

After discussing this with a friend (Svein E. Seldal - the maintainer of 
tic4x), he suggested from the top of his head 

char = int = short = 8 bit
long = 16 bit
long long = 32 bit

This is a very simple patch for GCC (just see below).  The only drawback is 
that 64 bit variables is not possible with -mint8.

Regardless of this patch, the good work in making avr-libc mint8 proof is very 
much appreciated.  As soon as inttypes.h is fixed, and used throughout 
avr-libc, future work (like changing the meaning of "long long") will not 
cause a broken libc.

Index: avr.h
===================================================================
RCS file: /cvsroot/gcc/gcc/config/avr/avr.h,v
retrieving revision 1.71
diff -c -3 -p -r1.71 avr.h
*** avr.h       24 Sep 2002 12:48:52 -0000      1.71
--- avr.h       12 Nov 2002 23:17:00 -0000
*************** extern int avr_asm_only_p;
*** 204,210 ****
     used in `cpp'.  */


! #define LONG_LONG_TYPE_SIZE 64
  /* A C expression for the size in bits of the type `long long' on the
     target machine.  If you don't define this, the default is two
     words.  If you want to support GNU Ada on your machine, the value
--- 204,210 ----
     used in `cpp'.  */


! #define LONG_LONG_TYPE_SIZE (INT_TYPE_SIZE == 8 ? 32 : 64)
  /* A C expression for the size in bits of the type `long long' on the
     target machine.  If you don't define this, the default is two
     words.  If you want to support GNU Ada on your machine, the value

-- 
Regards,
  Nils





reply via email to

[Prev in Thread] Current Thread [Next in Thread]