HDTenEightyP/NetNews huggingface dataset:
From: joe@proto.com (Joe Huffman)
Subject: Re: Wrong directions at Borland?
Organization: FlashTek, Inc.
Distribution: usa
Date: Mon, 14 Dec 1992 23:13:31 GMT

kanze@us-es.sel.de (James Kanze) writes:

>In article <1992Dec4.211512.4167@kronos.arc.nasa.gov>
>raymond@kronos.arc.nasa.gov (Eric A. Raymond) writes:

>|> Zortech has other problems.

>Technical or others? :-)

Well... they lost some developers when Symantec bought them and they haven't
been able to get an update out (except for some bug fixes) since July of '91.
They are about to ship 3.1 which will have some improvements in the compiler.
But still no 32-bit debugger -- that must come from FlashTek and that also 
requires an update to the 32-bit DOS extender.  List price for that 
combination is $500.00, Symantec is shipping a coupon in the box which will
get you the combination for $300.00.  And if you purchase Flash Graphics
from FlashTek at the same time you can get the bundle of all three for the
price of $400.00.  Flash Graphics hasn't been updated for over a year and
some customers are telling me that Symantec isn't even making any effort to
fix the bugs (most are rather obscure).

-- 
netcom!proto!joe
joe@proto.com
Newsgroups: comp.lang.c++
From: steve@taumet.com (Steve Clamage)
Subject: Re: static members in derived classes
Organization: TauMetric Corporation
Date: Sat, 12 Dec 1992 17:52:44 GMT

krc@wam.umd.edu (Kevin R. Coombes) writes:

>Can anyone explain why C++ has no equivalent? I've run into a number of
>situations when they might have been useful. I usually get around the
>problem by using a different static member for each derived class, and
>accessing them through virtual functions. This achieves the same goal,
>but since I have to carry this out manually, it is tedious and error-prone.
>Having "virtual static" data members would allow this proces to be carried
>out automatically by the compiler. I assume the reason this wasn't done is
>that it would break something else, but I can't see what.

"Virtual static" has been proposed from time to time.  I don't know of
any technical objections to it.  There are lots of good ideas for
extensions to C++.  The question is always one of evaluating the costs
and benefits of any proposed extension.

Bjarne Stroustrup published an article about proposing extensions to C++,
appearing in the June 1992 issue of C++ Report, and in the June 1992
(I think it was June) issue of ACM SIGPlan Notices.  It included an
extensive discussion about why not all good ideas should be accepted.
("Remember the Vasa!")  I can't say whether virtual static falls in the
category of "not quite good enough".

If you think virtual static should become part of C++, submit a complete
analysis along the lines described in the above paper.
-- 

Steve Clamage, TauMetric Corp, steve@taumet.com
Newsgroups: comp.lang.c++
From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
Subject: Re: Improvements on C++?
Organization: Computer Science, University of Melbourne, Australia
Date: Sat, 12 Dec 1992 16:15:05 GMT

maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:

>darcy@druid.uucp (D'Arcy J.M. Cain) writes:
>>
>>You can still do this without sacrificing speed and in fact enhance clarity:
>>
>>    while ((p = get()) != 0) {...}
>
>	The five extra characters make this clearer?

Yes.

They remind those of us who know 20 other languages where '=' means
equality, that in C '=' means assignment.

-- 
Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
This .signature virus is a self-referential statement that is true - but 
you will only be able to consistently believe it if you copy it to your own
.signature file!
Newsgroups: comp.lang.c++
From: jpolito@sysgem1.encore.com (Jonathan Polito)
Subject: Re: Should char arrays be deleted with delete[]?
Organization: Encore Computer Corp.
Date: Fri, 18 Dec 1992 18:53:29 GMT


In article <1992Dec18.161338.28124@promis.com> fogel@promis.com (Richard Fogel) writes:

   Should char strings allocated as follows:

   char *str = new char[10];

   later be deleted by:

   delete []str   OR    delete str  ?

   Thanks, this would be a great help, as the texts do not realy address this
   issue, and I understand that the wrong delete approach will cause unexplained
   results.

   Richard Fogel


See the ARM 5.3.4: "The form delete [] cast-expression is used to
delete arrays. The expression points to an array...The effect of
deleting an array with the plain delete syntax is undefined, as is
deleting an individual object with the delete [] syntax."

Now if only the InterViews folks would read the ARM.

--
Jonathan E. Polito 		    Internet: jpolito@encore.com
Encore Computer Corp, 901 Kildaire Farm Rd, Cary, NC  27511  USA
919-481-3730/voice  				919-481-3868/FAX
From: banshee@natinst.com (Jeff Kellam)
Newsgroups: comp.lang.c++
Subject: Re: How to call C++ functions in a C program?
Date: 17 Dec 1992 11:41:09 -0600
Organization: National Instruments, Austin, TX
Distribution: world
NNTP-Posting-Host: eagle.natinst.com

In article <1gqbepINNt6s@function.mps.ohio-state.edu> ren@function.mps.ohio-state.edu (Liming Ren) writes:
>Hi , Merry chrismas , everybody!
>
>I hope this queston makes sense.
>
>I know we can call C functions inside a C++ program. Is there a way to
>call a C++ function inside a C program? I tried to link  a C program with 
>a C++ function as follows:
>
>cc f.o g.c
>
>Where f.o has a very simple C++ function inside and g.c is a simple C
>program calling the function inside f.o. It dose not WORK!
>
>How to do this ? Please help!
>
>Many  thanks!

Basically, you can't.

The C++ compiler mangles the name of the C++ function, thus the linker won't
match it with the name you'd expect from C.  

If you know the name mangling scheme on your C++ compiler, you **might** be
able to use that name.  There are two limitations on this:

1.  C prepends an underscore to function names.  The mangling scheme your
	C++ compiler might not.

2.  Both of the C++ compilers I use include in the mangled name characters
	like @ and $ which are not valid in a C function name.

Of course, even if you get the name mangling taken care of, you'd still
have to handle things like explicitly passing a pointer to the object and
setting up virtual tables similar ugly things.  Thus my original answer,
you can't.

Regards,

jeff k
     
-- 
test
Newsgroups: comp.lang.c++
From: gs4t@virginia.edu (Gnanasekaran Swaminathan)
Subject: Re: Matrix Addition  Was Re: Complex Addition.
Keywords: operator, memory leak
Organization: University of Virginia
Date: Thu, 17 Dec 1992 20:40:49 GMT

gchow@hawai.inria.fr (Gloria Chow) writes:
: MATRIX& MATRIX::operator+( const MATRIX& addend )
: {
: register int    i,j;
: MATRIX          sum(nrows, ncols);
: 
:     for( i=0 ; i<nrows ; i++ )
:         for ( j=0 ; j<ncols ; j++ )
:             sum.entry[i][j] = entry[i][j] + addend.entry[i][j];
: 
:     return sum;
: }
: 
: 
: Okay, the problem is when I tried to use the "+" operator as follows:
: 
:     matrix_c = matrix_a + matrix_b;
: 
: the "+" operation works and sum contains the proper matrix, that is until
: "+" finishes and goes out of scope.  The "return" statement makes a temporary
: copy of sum (ie. the values of its nrows, ncols, and the pointer entry), and
: then proceed to destroy sum automatically.  So, now the entry pointer of this
: temporary is no longer pointing to a valid block of memory!!   

You are returning a reference to a local variable sum.
That is, no temporary copy is made in your case.
So, when the function operator+ goes out of scope, sum
gets destroyed and hence, the reference refers to junk.

One technique advocated several times in this forum and
by several good books is to use reference counting and 
return by value in case of big objects like Matrix.

For example,

class Matrix {
	struct MatRep {
		int	ref;
		int  	rows, cols;
		double*	d;
	
		MatRep (int r, int c)
		: ref(1), rows(r), cols(c), d(new double[rows*cols]) {}
		~MatRep () { delete [] d; }
	}* rep;
public:
	Matrix (int r, int c): rep(new MatRep(r,c)) {}
	Matrix (const Matrix& m): rep (m.rep) { ++rep->ref; }
	~Matrix () { if (--rep->ref == 0) delete rep; }

	double	operator () (int i, int j) { return rep->d[i*rep->rows+j]; }
	Matrix& operator =  (const Matrix& m) {
		if (this != &m) {
			this->Matrix::~Matrix (); // self destruct
			rep = m.rep; ++rep->ref;
		}
		return *this;
	}

	friend Matrix  operator + (const Matrix& a, const Matrix& b);
};

// note the return by value here
Matrix operator + (const Matrix& a, const Matrix& b)
{
	Matrix sum (a.rep->rows, a.rep->cols);
	for (int i=0; i < sum.rep->rows * sum.rep->cols;  i++)
		sum.rep->d[i] = a.rep->d[i] + b.rep->d[i];
	return sum;
}
	
	
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Give me safe C++
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Thu, 17 Dec 1992 19:23:01 GMT

In article <1992Dec14.190553.14838@mole-end.matawan.nj.us> mat@mole-end.matawan.nj.us writes:
>> 	So when language designers propose restrictions, one must
>> carefully weigh up the pros and cons: most restrictions also
>> grant freedom.  ...
>
>Absolutely.  But some languages would give you the virtual functions and
>take away the function pointers!
>
>The point is, I think, having the right tools for the job at hand.  Your
>high-level tools should be good enough that you'll never think of using
>anything else for a job they can do.  But when they can't do the job--or
>more likely, a small part of the job--you shouldn't have to forsake your
>high-level tools entirely as a punishment for once using a down-and-dirty
>approach.
>
>And  _that_ , I think, is one of great virtues of C++.  Whether you think
>of it as `seamless' or just forgiving, it's there.

	So, I feel unhappy when C/C++ takes away abilities
I have as an assembler programmer. I am especially annoyed
that NESTED FUNCTIONS are not supported.

	My very hardware (486) has direct support, and their
easily implemented on other machines with a display stack,
for example. While they were overused in Pascal, they are
quite handy. How can one call C++ a block structured
language otherwise? Anyone else for nested functions? Against?

	Next, I feel NO language has addressed the concept
of coroutines (except possibly Simula?). C provides
no simple exchange of control mechanism, although one
has to admit they can be emulated using objects in C++.
Yet many machines provide this facility, usually via
some exchange and link instruction.

	(I admit I dont know how to devise a coroutine
construct in a language, except for the simple case of
filters. But I cant be an expert at everything can I :-)


-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
From: ren@function.mps.ohio-state.edu (Liming Ren)
Newsgroups: comp.lang.c++
Subject: Re: How to call C++ functions in a C program?
Date: 17 Dec 1992 15:30:02 -0500
Organization: Department of Mathematics, The Ohio State University
NNTP-Posting-Host: function.mps.ohio-state.edu

First, I want to thank all those very knowledge people who responsed to my 
question. Some said yes and others saied no. I read all the resopnse carefully. 
It seems to me the answer is somewhere in  between. Is that true that for a C++ 
function to be callable in a C program, it must be written in C style? I tried:
 
foo.c:

#include<iostream.h>
//callable from C	
  extern "C" int callable_from_c (int i)
{
  cout<<"Merry Chrismas"<<endl;
  return i;
}


CC -c foo.c turns out all right!

When I call this function in a C program, I get error message as:

ld: Undefined symbol 
   _cout 
   _endl__FR7ostream 
   ___ls__7ostreamFPCc 
   ___ct__13Iostream_initFv 
   ___dt__13Iostream_initFv 

But if I erase the #include<iostream.h> line and the  cout line,
everything turns out to be all right.

Merry Chrismas!

Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Survey: File Extension
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Tue, 15 Dec 1992 13:48:47 GMT

In article <WARSAW.92Dec12174801@anthem.nlm.nih.gov> warsaw@nlm.nih.gov (Barry A. Warsaw) writes:
>
>More important is consistancy within your project and compilers/tools
>ought to be configurable to use just about any extension: .cc .cxx
>.cpp .C whatever...

Maybe, more important is to eventually have a proper module system
independent of the file system.

-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
From: clifford@fraser.sfu.ca (Clifford Earl Wiebe)
Newsgroups: comp.lang.c++
Subject: Object Oriented Databases (esp. ONTOS)
Date: 14 Dec 92 01:49:19 GMT
Article-I.D.: sfu.1992Dec14.014919.26088
Followup-To: comp.lang.c++
Organization: Simon Fraser University, Burnaby, B.C., Canada


Does anyone have any recommendations/experiences/horror stories 
about any of the object oriented databases that work with C++?
In particular, I'd like to know if anyone has had any experience with
the ONTOS or Object Store database products.  If so, what were your
thoughts on the DB's a) reliability, b) robustness, c) ease of use,
and d) any other comments you might have.

Is there a news group which discusses OO dbms?

Thanks,


Cliff
Newsgroups: comp.lang.c++
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Subject: Re: Need help implementic data structures of generic objects
Organization: MAXTAL P/L C/- University Computing Centre, Sydney
Date: Sat, 12 Dec 1992 19:27:52 GMT

In article <1992Dec11.233253.27540@informix.com> cshaver@informix.com (Craig Shaver) writes:
>In article <1992Dec10.114636.16861@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>>In article <42186@sdcc12.ucsd.edu> cs161feu@sdcc10.ucsd.edu (Anthony Minkoff) writes:
>>>Hi.  Another question from a C++ neophyte.
>>>
>....
>>>The approach that has been
>>>suggested is:
>>>
>>>class Object {
>>>    /* ...etc... */
>>>};
>>
>>	Dont do this Smalltalk hack please. A queue of Objects is
>>totally useless, since they are just Objects and not ever Widgets.
>
>YES! Do that elegant Smalltalk thing.  Do not listen to C++ hacks and
>bigots.  Put a little thought into it and do something (re)useful.
>

	If you want to do this, go ahead, but do it in the language
designed for it - Smalltalk. Trying to emulate Stalk in C++ will
bring grief, if you dont believe me look at some Smalltalk derived
C++ libraries.

	C++ has a different philosophy than Stalk, and I humbly
suggest its better to try to understand this philosohpy and use
it to best advantage than attempt to emulate a diametrically opposed
one.

	If you follow the Stalk root object method in C++ you will
have to downcast, if the root is a virtual base this is currently
illegal. Even when it becomes legal, it is not a recommended
procedure---it is inherently unsafe. Casting is not provided for
ordinary programming tasks: its better to use the strong typing
system than bypass it with casts.

	Try reading The C++ Programming Language (second edition) 
by Bjarne Stroustrup. Especially Ch 12 and 13.

	Try using templates for containers.

	Try using multiple inheritance, abstraction, 
and virtual bases (even mixins if your compiler supports them).

	There is a great richness of ideas in C++, if you
run out, read Coplien :-) Then try to figure out mixins,
no one has written a book on that yet.
 
-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Newsgroups: comp.lang.c++
From: sabroe@daimi.aau.dk (Morten Sabroe Mortensen)
Subject: Operator "new" - how to catch array-allocation?
Organization: DAIMI: Computer Science Department, Aarhus University, Denmark
Date: Mon, 14 Dec 92 14:33:39 GMT


As you know, it's possible to attach a special 'new' operator on a
specific class, -something like

...

class A
{
  ...

public:
  void* operator new(size_t s);
}

...

So, well, -when doing something like

A* a=new A;

the new 'new' for my class A is used, but when doing something like

A* a=new A[25];

the global new operator is used, it seems! Can it be true, it should
work like this? Until I tried, I thought, A's 'new' would just get a bigger
argument - but maybe there is a very good reason, it works like this?
Please tell me about it! No way to catch array-allocation for a class? 
Same question goes for 'delete'. Comments and explanations greatly
appreciated!


        -- Morten.

---------------------------------------------------------------------------
 Morten Sabroe Mortensen,         e-mail: sabroe@daimi.aau.dk
 Department of Computer-science - University of Aarhus, Denmark.
---------------------------------------------------------------------------

Newsgroups: comp.lang.c++
From: nikki@trmphrst.demon.co.uk (Nikki Locke)
Subject: Re: Destructor Question
Reply-To: nikki@trmphrst.demon.co.uk
Distribution: world
X-Mailer: cppnews $Revision: 1.30 $
Organization: Trumphurst Ltd.
Date: Mon, 14 Dec 1992 14:48:55 +0000

In article <1992Dec11.030820.3207@netcom.com> ort@netcom.com (David Oertel) writes:
> nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
> >Please let me know which compilers fail to destruct objects with global 
> >scope on (normal) exit from the program (via return from main or call of 
> >exit), so that I may avoid using them.

..

> 	It seems that there is no question as to whether or not destructors
> 	are called.

My point precisely !

(I really must try not to make tongue-in-cheek remarks until I learn what the 
official tongue-in-cheek smiley is :~).
-- 
Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
Newsgroups: comp.lang.c++,comp.std.c++
From: jegm@cody.esd.sgi.com (Jim Morris)
Newsgroups: comp.lang.c++
Subject: Re: Zortech C++ v3.1
Date: 15 Dec 1992 18:30:55 GMT
Organization: Silicon Graphics, Inc.
Distribution: usa
Reply-To: jegm@esd.sgi.com
NNTP-Posting-Host: cody.esd.sgi.com

In article <1992Dec14.232333.1059@proto.com>, joe@proto.com (Joe Huffman) writes:
|> jordan@aero.org (Larry M. Jordan) writes:
|> 
|> >[2] Does the debugger debug ALL memory models?  Does the debugger debug 
|> >    the DOS extender code?
|> 
|> No.  But ou can get a version of the ZDB debugger under the name of 
|> FlashView from FlashTek that does support 32-bit DOS extender code.  
|> See the coupon that comes in the Zortech box for more details and prices...

Are you saying that Symantec is shipping a 32-bit c compiler that can't debug
its own generated code? I find this hard to believe. If its true I'll be
returning Zortech 3.1 that I just ordered ASAP!!


|> 
|> >[3] Does the debugger support AT&T version 3.0? 
|> 
|> What sort of things does it have to do to provide this support?

Templates and nested classes.

|> 
|> >[4] Has the earlier debugger been completely supplanted by Multiscope?
|> 
|> You get a somewhat updated version of ZDB with the product, but no 32-bit
|> DOS extender support.

Again I find it hard to believe that you can't debug 32 bit code!!

|> 
|> >[5] Is the product shipping as we speak?
|> 
|> Not according to my sources.  I got a beta copy early last week, this was
|> supposed close to the final, but that was a bit unclear to me.

I just ordered 3.1 on Friday, they said it would be delivered in 5-7 days.

|> 
|> >I'd appreciate a Semantic response.
|> 
|> I don't work for Symantec.  I work for FlashTek who supplied the DOS 
|> extender DOSX, debugger (ZDB) and FG to Symantec.

What is 'FG' ?

-- 
Jim Morris, Email: jegm@esd.sgi.com  Voice: (415) 390-5136
Newsgroups: comp.lang.c++
From: ykim@cs.columbia.edu (Yong Su Kim)
Subject: profiling g++ code
Organization: Columbia University Department of Computer Science
Distribution: usa
Date: Sat, 19 Dec 1992 02:50:58 GMT


I have a C++ program and I would like to profile it to see which
functions are taking the most time so that I can optimise those
functions. 

I tried g++ -p, but I get an error message saying that the symbol
"mcount" is undefined.

Are there other ways, or other programs which will allow me to
determine which functions are taking the most time?
-- 
===============================================================================
Yong Su Kim, Class of 1993		|  Internet: yk4@cunixb.cc.columbia.edu
Columbia College, Columbia University   |        or  ykim@cs.columbia.edu
From: warsaw@nlm.nih.gov (Barry A. Warsaw)
Newsgroups: comp.lang.c++
Subject: Re: Give me safe C++
Date: 12 Dec 92 22:41:37 GMT
	<WARSAW.92Dec11124441@anthem.nlm.nih.gov>
	<1992Dec12.145403.26483@ucc.su.OZ.AU>
Reply-To: warsaw@nlm.nih.gov (Barry A. Warsaw)
Organization: Century Computing, Inc.


>>>>> "John" == John MAX Skaller <maxtal@extro.ucc.su.OZ.AU> writes:

    John> 	While tending to support your liking of the C++ 'hybrid'
    John> approach, I'm not so sure about 'seamlessly', are you?

I think it is rather seamless in the sense that I can solve problems
(or typically, subproblems of a larger, integrated system) using a
functional, ADT, and/or OOP approach, and I can develop all these
parts in a single language.  Everything doesn't have to be a class in
C++ and not all classes have to use inheritance and polymorphism. My
only point was that I don't have to jump through hoops to solve a
problem using these different abstraction levels.  Maybe we're talking
about different things when we say "seamless"?
Newsgroups: comp.lang.c++
From: warsaw@nlm.nih.gov (Barry A. Warsaw)
Subject: Re: Give me safe C++
Reply-To: warsaw@nlm.nih.gov (Barry A. Warsaw)
Organization: Century Computing, Inc.
	<9234501.15945@mulga.cs.mu.OZ.AU> <Bz2nDF.7B6@fiu.edu>
Date: 11 Dec 92 17:44:41 GMT


>>>>> "Michael" == Michael Feathers <feathers@serss0> writes:

    Michael> The Ada people had the best of intentions, I'm sure, but
    Michael> I think that C and C++ are versatile languages precisely
    Michael> because no one ever tried to limit their functionality
    Michael> with good intentions.

Agreed. IMHO, the real power of C++ as a development language is the
ability to easily climb up and down the abstraction ladder depending
on the context of the problem.  Sometimes you need to mingle with the
bits in the basement, sometimes you just need ADTs and sometimes you
really want to do OOP.  The beauty of C++ is that it seamlessly
supports many levels of abstraction.
Newsgroups: comp.lang.c++
From: gbj@melb.bull.oz.au (Graham Jose)
Subject: C++ & Assembler
Organization: Bull HN Information Systems Australia.
Date: Mon, 21 Dec 1992 00:58:28 GMT

I have been using Borland C++ 3.1 to put together a program which
consists of a relatively small C++ Windows module linked to about 50
assembler object modules. The assembler code uses a variety of code
and data segments. My problem is that when it has all successfully
linked, the final executable size is approx. 512Kb, which is not
excessively large, however, Windows keeps reporting that the program
is too large to fit in memory, when I try to execute it. Can anybody
give me some hints into where I am possibly going wrong? Are there
certain procedures I need to follow in my definition of code and data
segments in my assembler code that could cause this problem?

Any help would be much appreciated,

Regards,
Graham Jose

 ---------------------------------------------------------------------------
| Graham Jose, Snr Software Engineer (EFTPOS,Comms) |   Phone: 61 3 2464450 |
| Melbourne Development Centre     (Unix, DOS, OS2) |     Fax: 61 3 2464445 |
| Bull HN Information Systems Australia Pty Ltd     |-----------------------|
| ACSnet  : gbj@bull.oz                             |  C A R P E   D I E M  |
| Internet: gbj@melb.bull.oz.au                     |    'Seize the day'    |
 ---------------------------------------------------------------------------