🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.c++
Article #65

Re: Compiler bug report (#2)

#65
From: Steve Rumsby
Date: Thu, 20 Mar 1986 11:20
32 lines
1394 bytes
In article <869@inset.UUCP> dave@inset.UUCP (Dave Lukes) writes:
>In article <261@euclid.warwick.UUCP> steve@warwick.UUCP (Steve Rumsby) writes:
>>
>> ....
>>
>>	char *const foo = "hello world";
>>
>>	main()
>>	{
>>		char *cp = foo;
>>	}
>>
>
>Surely you would expect that: the erroneous line SHOULD read:
>>		char *cp = (char *)foo;

No, why? foo already *is* a (char *) - it just happens to be a constant one.
Are you suggesting the we all should start writing

	int i = (int)42;

After all, 42 isn't an "int", it's a "const int" isn't it :-) Seriously tho',
why should I have to cast the value of foo from "char *const" to "char *"
before I can use its value?

					Steve.

-- 

					Steve Rumsby.

				    ...!ukc!warwick!steve.
Technical Details
Message-ID: <267@euclid.warwick.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!warwick!steve
References: <261@euclid.warwick.UUCP> <869@inset.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!mcvax!ukc!warwick!steve
From: steve@warwick.UUCP (Steve Rumsby)
Newsgroups: net.lang.c++
Subject: Re: Compiler bug report (#2)
Message-ID: <267@euclid.warwick.UUCP>
Date: Thu, 20-Mar-86 06:20:00 EST
Article-I.D.: euclid.267
Posted: Thu Mar 20 06:20:00 1986
Date-Received: Sat, 22-Mar-86 22:22:49 EST
References: <261@euclid.warwick.UUCP> <869@inset.UUCP>
Reply-To: steve@euclid.UUCP (Steve Rumsby)
Distribution: net
Organization: Maths Institute, Warwick University, UK
Lines: 32