Path: utzoo!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!unmvax!pprg.unm.edu!hc!lll-winken!uunet!philmtl!philabs!linus!news From: news@linus.UUCP (USENET NEWS) Newsgroups: comp.lang.c++ Subject: Are C++ translators usable under Xenix? Message-ID: <53174@linus.UUCP> Date: 12 May 89 16:15:14 GMT Reply-To: nsds@mbunix.mitre.org (Neil Smith) Organization: The MITRE Corporation, Bedford, Mass. Lines: 57 Here's a nice juicy implementation-related topic (just when you thought the language lawyers were having all the fun). I'm working on porting some C++ code (developed using an AT&T-derived translator under Ultrix) to Xenix-386. The Xenix C++ development environment (also using an AT&T-derived translator) naturally uses the native Xenix C compiler to generate object files from the translated C++. As it turns out, that C compiler recognizes unique identifiers only through the first 31 characters. This causes compiles to fail, since cfront transforms C++ identifiers into rather long C identifiers. From: nsds@mbunix.mitre.org (Neil S. Smith) Path: mbunix!nsds An example: the code fragment #include istream *qin; ostream *qout; int foo(streambuf *sba, streambuf *sbb) { qin = new istream(sba); qout = new ostream(sbb); return 0; } causes the generation of (among other things): ... register struct istream *_au0__Xthis__ctorFPCstreambuf__I_PC_ostream___istream = 0; struct ostream *_au0__Xthis__ctorFPCstreambuf___ostream ; ... Both of these declarations are identical in the first 31 characters, so the C compiler chokes when trying to process this code. The Ultrix C++ translator has no problems with this; I believe that its cc can handle identifers out to 256 characters. Now for the questions: Am I up the proverbial creek (I believe so)? Has anyone else run into this problem, and/or found a workaround? Please don't tell me to re-write the code so that cfront generates an identifier of < 31 characters. Considering the simplicity of the constructs involved, this problem represents a significant limitation with the IMPLEMENTATION of cfront-style C++ translators that use compilers with (relatively) short identifier lengths. I should think that MSDOS-hosted translators using Microsoft C would suffer from the same problem... Sigh...maybe this will convince the powers-that-be go to sys V... --------------------- Neil Smith "Relax, don't worry, have a homebrew!" The MITRE Corporation M/S B310 Burlington Road Bedford, MA 01730 Ma Bell: (617) 271-8278 Internet: nsds@mitre.org