From -4318398958993378842
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1149ec,c5e1f3188bfb5123
X-Google-Attributes: gid1149ec,public
X-Google-Thread: f78e5,c5e1f3188bfb5123
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2000-11-01 08:45:38 PST
Path: supernews.google.com!sn-xit-02!sn-xit-03!supernews.com!newsfeed.direct.ca!look.ca!newsfeed.icl.net!dispose.news.demon.net!demon!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail
From: James.Kanze@dresdner-bank.com
Newsgroups: comp.std.c++,comp.std.c
Subject: Re: C and C++ Standard incompatibility for signed character type
Date: Wed,  1 Nov 2000 16:44:48 GMT
Organization: Deja.com - Before you buy.
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <8tov45$l1n$1@nnrp1.deja.com>
References: <mDjqOSLqT7Z8L1bgEhHCTMYSNiXB@4ax.com> <jhwOgsPqbL75EwTv@romana.davros.org> <39F254C8.510803FB@null.net> <8666mkbq7h.fsf@gabi-soft.de> <slrn8vrl3c.uu1.Team-Rocket@nightrunner.nm.dnsalias.net> <dzziwbC2ig$5EwlD@ntlworld.com> <slrn8vs450.igr.Team-Rocket@nightrunner.nm.dnsalias.net> <c5vCyUAGAq$5EwFI@ntlworld.com>
X-Trace: mail2news.demon.co.uk 973097097 mail2news:21206 mail2news mail2news.demon.co.uk
X-Complaints-To: abuse@demon.net
X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Article-Creation-Date: Wed Nov 01 11:34:29 2000 GMT
X-Http-User-Agent: Mozilla/4.72 [en] (WinNT; I)
X-Http-Proxy: 1.0 x70.deja.com:80 (Squid/1.1.22) for client 193.194.7.77
X-MyDeja-Info: XMYDJUIDkanze
Lines: 52
Xref: supernews.google.com comp.std.c++:1854 comp.std.c:1520

In article <c5vCyUAGAq$5EwFI@ntlworld.com>,
  Francis Glassborow <francisG@robinton.demon.co.uk> wrote:
> In article <slrn8vs450.igr.Team-Rocket@nightrunner.nm.dnsalias.net>,
> Niklas Matthies <Team-Rocket@gmx.net> writes
> >On Mon, 30 Oct 2000 23:51:03 GMT, Francis Glassborow
<francis.glassborow@ntlworld.com> wrote:
> >> In article
<slrn8vrl3c.uu1.Team-Rocket@nightrunner.nm.dnsalias.net>,
> >> Niklas Matthies <Team-Rocket@gmx.net> writes
> >> >It's not (in C). The uninitialized chars may have trap values
> >> >(for the type char)

> >> Please quote text to support this claim

> >It's the other way round. The standard does not specify such a
> >guarantee (unless I missed something), therefore there is none.

> The C standard requires that unsigned char has no trap values (that
> can be deduced from the rules for type punning etc.) It also
> requires that char can be exactly accessed as an unsigned char
> though the negative values will be mapped to positive values beyond
> the maximum value for char (assuming it is a signed version). I do
> not see how these requirements can allow for the existence of trap
> values.

And I don't see what is to prevent them.  Again, take Clive's example:

    CHAR_BIT == 10
    UCHAR_MAX == 1023
    CHAR_MAX == 255
    CHAR_MIN == -256

This obviously allows trapping values for char.  It also easily meets
the requirements you give.

--
James Kanze                               mailto:kanze@gabi-soft.de
Conseils en informatique orient�e objet/
                   Beratung in objektorientierter Datenverarbeitung
Ziegelh�ttenweg 17a, 60598 Frankfurt, Germany Tel. +49(069)63198627


Sent via Deja.com http://www.deja.com/
Before you buy.

---
[ 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.     ]



