This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Pascal Strings -- TAKE FOUR


> Date: Tue, 3 Jul 2001 16:33:53 -0700
> From: Ziemowit Laski <zlaski@apple.com>

> On Tuesday, July 3, 2001, at 04:34 , Geoff Keating wrote:
> 
> > The explicit constant 255 is wrong, there are some platforms that GCC
> > supports where char is 16 bits.  There are a number of places in your
> > patch where that needs fixing.
> 
> Please advise on how I should encode that information -- I'm tempted to
> say
> 
>     ((unsigned char)-1)

No, that won't work either, that will give the size of 'unsigned char'
on the machine GCC is being hosted on, not on the target.

> but perhaps there's some macro somewhere in the bowels of gcc that's
> more suitable?

You want CHAR_TYPE_SIZE, which is the number of bits in a 'char' for
the target.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]