🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4667

Re: ... char * * promotion to char const * const * ...

#4667
From: J. Kanze
Date: Thu, 18 Jan 1996 16:15
21 lines
1563 bytes
John Winters (john@polo.demon.co.uk) wrote:
|> In article <KANZE.96Jan17121659@slsvewt.lts.sel.alcatel.de>,
|> James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de> wrote:
|> [snip]
|> >
|> >Originally, the C standard was going to allow this; in fact, it was
|> >going to allow all casts which added const anywhere in the type.  Then
|> >someone pointed out that the conversion 'char ** -> char *const *' was
|> >unsafe.  As a result, the wording was changed to only allow adding the
|> >const at the top level.

|> Interesting.  Could you enlighten us (well, me anyway) as to *why* it
|> is unsafe.  I don't find it immediately obvious.

As another poster has already pointed out, I gave the wrong conversion
as unsafe.  (That's what comes of typing faster than you think.)
-- 
James Kanze           (+33) 88 14 49 00          email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs Bourgeois, 67000 Strasbourg, France
Conseils, études et réalisations en logiciel orienté objet --
              -- A la recherche d'une activité dans une region francophone
Technical Details
Message-ID: <4dlrn5$81e@gabi.gabi-soft.fr>
Path: arc1-ca.pugleaf.net!gabi-soft.fr!not-for-mail
References: <4dgj8q$qin@unix.sri.com> <KANZE.96Jan17121659@slsvewt.lts.sel.alcatel.de> <DLBzGB.J60@polo.demon.co.uk>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!gabi-soft.fr!not-for-mail
From: kanze@gabi-soft.fr (J. Kanze)
Newsgroups: comp.std.c
Subject: Re: ... char * * promotion to char const * const * ...
Date: 18 Jan 1996 17:15:33 +0100
Organization: GABI Software, Sarl.
Message-ID: <4dlrn5$81e@gabi.gabi-soft.fr>
References: <4dgj8q$qin@unix.sri.com> <KANZE.96Jan17121659@slsvewt.lts.sel.alcatel.de> <DLBzGB.J60@polo.demon.co.uk>
NNTP-Posting-Host: gabi.gabi-soft.fr
X-Newsreader: TIN [version 1.2 PL2]