Article View: net.lang.c++
Article #223long names (was C++ availability)
From: Bjarne Stroustrup
Date: Tue, 17 Jun 1986 14:59
Date: Tue, 17 Jun 1986 14:59
47 lines
2965 bytes
2965 bytes
> Reply-To: gdykes@batcomputer.UUCP (Gene Dykes)
> Organization: Theory Center, Cornell University, Ithaca NY
>
> >Has anybody attempted to port C++ to VMS using the VAX 11 C compiler?
>
> I am also very interested in this question. At least one problem with
> the VMS C compiler is that the variable names it allows are somewhat
> limited in length (32 or 40 characters, I think). Would it be possible
> to write a C++ post processor that creates suitable names or is that
> an enormous can of worms?
>
> Gene Dykes, 120 Rand Hall, Cornell U., Ithaca, NY 14853 (607)255-6713
> {ihnp4,decvax,allegra,vax135}!cornell!batcomputer!gdykes
I'm told that C++ has been ported to VMS, to Eunice, and MS/DOS all of
which have name length restrictions. I was told it was not hard. It shouldn't
be, but I have no idea what they considered ``hard''. Sorry, I don't have
a name and address for VMS, and (shock horror) many C++ installations -
especially in the commercial and non-Unix worlds are not on the net.
The 31 character limit is no problem for the C++ translator itself or for
the standard libraries only a potential problem for user programs. Most
users will not encounter it, and the users that do encounter it will see
it as a linker problem: Programs that cause very long names that are not
unique in the first X characters will not load. Typically slight modifucations
of the ``offending'' program will remove the problem. Very long names are
generated for
(1) overloaded functions with many class names in their argument type
lists. For example:
class X {
X& f(X*,Y,Z,Z,Z,Y*,Y*,X);
X& f(X*,Y,Z,Z,Z,Y*,Y*,Y); // potential problem
X& f(Y*,Y,Z,Z,Z,Y*,Y*,Y); // not a problem
};
will cause problems on a machine with a 31 character limit for
names if the class names X, Y and Z has many characters (but
typically not if they are short names). Note also that because
the standard encoding maps argument types into names in order
a differences in the initial argument types curcumvents this
kind of problems.
(2) names of arguments and local variables in inline functions (again
only if you have quite long names in your source text).
The idea of shortening names by a post processor is a can of worms. It makes
debugging truly horrible. If you MUST shorten names do it by modifying
type::signature() in print.c to use a more compact encoding of overloaded
function names.
Technical Details
Message-ID:
<5653@alice.uUCp>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!alice!bsShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!allegra!alice!bs From: bs@alice.UucP (Bjarne Stroustrup) Newsgroups: net.lang.c++ Subject: long names (was C++ availability) Message-ID: <5653@alice.uUCp> Date: Tue, 17-Jun-86 10:59:54 EDT Article-I.D.: alice.5653 Posted: Tue Jun 17 10:59:54 1986 Date-Received: Wed, 18-Jun-86 05:34:09 EDT Organization: Bell Labs, Murray Hill Lines: 47