From -8823486549043822515
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1149ec,c5e1f3188bfb5123
X-Google-Attributes: gid1149ec,public
X-Google-Thread: f78e5,c5e1f3188bfb5123
X-Google-Attributes: gidf78e5,public
From: "Clive D.W. Feather" <clive@on-the-train.demon.co.uk>
Subject: Re: C and C++ Standard incompatibility for signed character type
Date: 2000/10/17
Message-ID: <jhwOgsPqbL75EwTv@romana.davros.org>#1/1
X-Deja-AN: 682620161
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
References: <mDjqOSLqT7Z8L1bgEhHCTMYSNiXB@4ax.com>
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Trace: mail2news.demon.co.uk 971817373 mail2news:14574 mail2news mail2news.demon.co.uk
Organization: Demon Internet
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
MIME-Version: 1.0
Reply-To: "Clive D.W. Feather" <clive@demon.net>
Newsgroups: comp.std.c++,comp.std.c

In article <mDjqOSLqT7Z8L1bgEhHCTMYSNiXB@4ax.com>, Jack Klein
<jackklein@spamcop.net> writes
>Both the C99 (ISO 9899:1999) and C++ (ISO 14882:1998) are claimed to
>be compatible with the original ISO C standard in terms of the
>original integral types (char, short, int, long),

I'm not sure what that is supposed to mean.

>Both purport that descriptions of padding bits and trap
>representations were allowed, just not documented, in ISO C 90.

WG14, when asked detailed questions about C90, gave a set of answers.
The meaning of these answers were included in the C99 review.

>C++ 1998 3.9.1 paragraph 1:
[...]
>This rules out padding bits in signed char, but permits trap
>representations.
>
>C99 6.2.6.2 paragraph 2:
[...]
>There is specifically no contrary wording for signed char, so under
>this standard signed char can have both padding bits and trap
>representations.

Correct. This means that WG14 and WG21 made different decisions.

In particular, a system with (say) 10 bit bytes might want signed char
to be [-256,255].

-- 
Clive D.W. Feather    | Internet Expert      | Work: <clive@demon.net>
Tel: +44 20 8371 1138 | Demon Internet       | Home: <clive@davros.org>
Fax: +44 20 8371 1037 | Thus plc             | Web:  <http://www.davros.org>
Written on my laptop; please observe the Reply-To address

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]
[ Note that the FAQ URL has changed!  Please update your bookmarks.     ]




