🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #4677

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

#4677
From: John Winters
Date: Fri, 19 Jan 1996 11:24
27 lines
1643 bytes
In article <4dlrn5$81e@gabi.gabi-soft.fr>, J. Kanze <kanze@gabi-soft.fr> wrote:
>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.)
>-- 

But that wasn't what caused me to be unable to understand.  Even with the
correction I still couldn't see it without following the explanation
very closely.  An amusing little hole - reminds me of group theory.

John

-- 
John Winters.  Wallingford, Oxon, England.
Technical Details
Message-ID: <DLFED5.70H@polo.demon.co.uk>
Path: arc1-ca.pugleaf.net!zetnet.co.uk!demon!polo!john
References: <4dgj8q$qin@unix.sri.com> <KANZE.96Jan17121659@slsvewt.lts.sel.alcatel.de> <DLBzGB.J60@polo.demon.co.uk> <4dlrn5$81e@gabi.gabi-soft.fr>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!zetnet.co.uk!demon!polo!john
From: john@polo.demon.co.uk (John Winters)
Newsgroups: comp.std.c
Subject: Re: ... char * * promotion to char const * const * ...
Date: Fri, 19 Jan 1996 11:24:40 GMT
Organization: Wallingford
Message-ID: <DLFED5.70H@polo.demon.co.uk>
References: <4dgj8q$qin@unix.sri.com> <KANZE.96Jan17121659@slsvewt.lts.sel.alcatel.de> <DLBzGB.J60@polo.demon.co.uk> <4dlrn5$81e@gabi.gabi-soft.fr>
X-NNTP-Posting-Host: polo.demon.co.uk