🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #218

Re: const T **

#218
From: Richard A. O'Keefe
Date: Wed, 15 Apr 1992 04:38
23 lines
1480 bytes
In article <1611@imec.UUCP> donne@imec.be (Werner Donne) wrote:
> Why is the assignment illegal?
In article <1992Apr15.014523.5364@cs.mcgill.ca>,
storm@cs.mcgill.ca (Marc WANDSCHNEIDER) replied:
> As far as I can see, it isn't.  I ran it on cc for the NeXTs, gcc
> running under SunOS 4.1.1 and as well, on MSC and Borland C++ 3.0 on my
> PC in front of me...  Not one compiler even complained about the assignment.

Encore Multimax running their version of 4.3BSD:
% cat foo.c
int main(void) { const char **a; char **b; a = b; return 0; }
% gcc -ansi -pedantic foo.c
foo.c: In function main:
foo.c:1: warning: assignment between incompatible pointer types

Quite right too.  The handling of read/write modifiers on pointers
was pretty well worked out in Mark Rain's "MARY" language, so there
was relevant (MARY was an Algol-68-derivative for systems programming)
prior art.
-- 
I am writing a book on debugging aimed at 1st & 2nd year CS students using
C/Modula/Pascal-like languages.  Please send suggestions (other than "you
_must_ cite "C Traps and Pitfalls") to ok@goanna.cs.rmit.oz.au
Technical Details
Message-ID: <10279@goanna.cs.rmit.oz.au>
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!goanna!ok
References: <1611@imec.UUCP> <1992Apr15.014523.5364@cs.mcgill.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!munnari.oz.au!goanna!ok
From: ok@goanna.cs.rmit.oz.au (Richard A. O'Keefe)
Newsgroups: comp.std.c
Subject: Re: const T **
Keywords: const
Message-ID: <10279@goanna.cs.rmit.oz.au>
Date: 15 Apr 92 04:38:51 GMT
References: <1611@imec.UUCP> <1992Apr15.014523.5364@cs.mcgill.ca>
Organization: Comp Sci, RMIT, Melbourne, Australia
Lines: 23