🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #604

Re: character array initialization

#604
From: Dave Scidmore
Date: Wed, 21 Nov 1990 23:19
39 lines
2561 bytes
In article <59110@microsoft.UUCP> petergo@microsoft.UUCP (Peter GOLDE) writes:
|In article <513@taumet.com> steve@taumet.com (Stephen Clamage) writes:
|>petergo@microsoft.UUCP (Peter GOLDE) writes:
|>
|>>In section 8.4.2, the C++ standard disallows the legal ANSI C
|>>initialization:
|>>char cv[4] = "asdf";
|>
|>I agree that this restriction will break some existing code.  But how
|>often is it essential to use a fixed-size array of characters without
|>the terminating null?  To cater to those special cases, IMHO very rare,
|>C introduces weird semantics for array initialization.  In addition, it
|>seems to me that 
|>	char cv[4] = "asdf";
|>is more likely to be an error than a deliberate attempt to save one byte.
|
|A good argument.  I might even accept it, were I designing a language
|myself.  But many of the best C language experts in the country
|(the ANSI C committee) considered this argument, and rejected it.
|The issue should be closed now.

This argument is based on the false assumption that the ANSI C committie
was trying to adopt the ideal set of 'C' language features as a standard.
It was not, in fact the ANSI 'C' specification specificaly states that the
ANSI 'C' committies charter was to CODEFY EXISTING PRACTICE. It would be
far more correct to say "many of the best C language experts in the country
(the ANSI C committee) considered this argument and found it did not correspond
to existing practice".
    The ANSI committie did not set out to enhance or correct language features.
The goals for the development of C++ are far different. Since the existing
practice criteria for development was invalid, the goal was primarily to
enhance the language and correct percieved problems with the original 'C'
language.
	Because of stronger type checking and other changes in the language
it is nearly impossible to port 'C' code to 'C++' anyway, this is just another
area of incompatibility to deal with.
--
Dave Scidmore, Heurikon Corp.
dave.scidmore@heurikon.com
Technical Details
Message-ID: <1056@heurikon.heurikon.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwvax!heurikon!ex.heurikon.com!daves
References: <58962@microsoft.UUCP> <513@taumet.com> <59110@microsoft.UUCP> <59138@microsoft.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwvax!heurikon!ex.heurikon.com!daves
From: daves@ex.heurikon.com (Dave Scidmore)
Newsgroups: comp.std.c++
Subject: Re: character array initialization
Message-ID: <1056@heurikon.heurikon.com>
Date: 21 Nov 90 23:19:07 GMT
References: <58962@microsoft.UUCP> <513@taumet.com> <59110@microsoft.UUCP> <59138@microsoft.UUCP>
Sender: news@heurikon.heurikon.com
Reply-To: daves@ex.heurikon.com (Dave Scidmore)
Organization: Heurikon Corporation, Madison, WI
Lines: 39