HDTenEightyP/NetNews huggingface dataset:
From: doug@monet.ads.com (Doug Morgan)
Subject: Re: Undoing, Emacs and unlimited files ... summery.
Organization: Advanced Decision Systems, Mountain View, CA 94043, +1 (415)
	960-7300
	<NMOUAWAD.92Jul27131847@math.waterloo.edu>
Date: Mon, 27 Jul 1992 20:08:17 GMT

In article <NMOUAWAD.92Jul27131847@math.waterloo.edu> nmouawad@waterloo.edu (Naji Mouawad) writes:
   ...
   I stand corrected on my assumption regarding Emcas' ability to handle
   unlimited file size. Almost everyone pointed out that Emacs (in almost
   all its incarnations) does not handle unlimited file size. The limit
   is determined by available (virtual) memory. 

   --
	-------------------------------------------------------------------
       | Naji Mouawad  |          nmouawad@watmath.waterloo.edu            |
       |  University   |---------------------------------------------------|
       | Of Waterloo   |   "The Stranger in us is our most familiar Self"  |
	-------------------------------------------------------------------

Correct operation of GNU emacs is limited to 8 Mbyte files because of
use of 24 bit representation for integers.  It will generally read in
and do some reasonable editting on larger files, but marks, points,
regions, and other things start to behave oddly.  Be careful.

doug
------------------------------------------------------------
Doug Morgan, doug@ads.com, (415) 960-7300
Advanced Decision Systems (a division of Booz-Allen & Hamilton Inc.)
1500 Plymouth St., Mountain View, CA 94043-1230
From: rwk@silver.sbi.com (Richard W. Kreutzer(Consultant))
Newsgroups: comp.lang.c++
Subject: gdb-4.6
Date: 29 Jul 92 15:44:15 GMT
Distribution: comp
Organization: Olympus Software, Inc.

An advertised new feature of gdb-4.6 is that it works with name manglers other
than g++.

Has anyone gotten gdb-4.6 to work with ATT cfront name mangling?

I am using cfront 2.1 and gdb-4.6 dumps core attempting to read the symbol
table of any executable produced with Sun C++ version 2.1.  I am running on a
Sparc 1+ under SunOS 4.1.1.

The problem occurs with or without ATT name mangling enabled.

Dick



--

--
        Richard W. (Dick) Kreutzer
Net:    rwk@quark.sbi.com				CIS:	70702,2174
Voice:  +1(801)571-2446					FAX:	+1(801)571-2448
Mail:   Integra Software Corp.; 1378 Jasmine Avenue; Sandy, UT 84092 (USA)
Xref: sparky comp.lang.c++:11653 comp.std.c++:969
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: run-time type checking (was: Re: Covariant Types in Derived Classes)
Date: 28 Jul 92 16:28:57 GMT
Reply-To: tmb@idiap.ch
Followup-To: comp.lang.c++
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
In-reply-to: shang@corp.mot.com's message of 27 Jul 92 16:14:41 GMT

In article <1992Jul27.161441.7898@cadsun.corp.mot.com> shang@corp.mot.com (David (Lujun) Shang) writes:

   I may write:

	   bestow_on (victor).

   where bestow_on is a function which gives a female peer to the victor (suppose  
   only the male can fight):

	  void bestow_on (Animal * victor)
	  {    Animal * f = new typeof(*victor)(female));
	       // suppose we need do some work for the female here
	       // ...
	       victor->mate(f); // type inference here ensure that f is the 
				// correct type and the downcast is safe
	  };

   here both RTTI and downcast are needed, though I did not write an explicit  
   downcast which is actually happen in the call of "mate":

They are not "needed". You can simply make "bestow_on" a virtual
member function of "Animal" and have it do the right thing for each
kind of animal.

Is this pedestrian? You bet it is, but no more so than many other
aspects of C++ (e.g., memory management has to be handled on a
per-class basis, value semantics have to re-implemented on a
case-by-case basis, etc.).

If you think you really need those features, there is always CLOS...

					Thomas.
Newsgroups: comp.lang.c++
From: mat@uunet.uu.net!mole-end
Subject: Re: Q: static members and private constructors
Summary: A bug, actually
Organization: :
Date: Sat, 25 Jul 1992 07:07:32 GMT

In article <18607@drutx.ATT.COM>, weh@abasin.dr.att.com (William E. Hopkins) writes:
> In article <YDD5OTF@hp832.informatik.hu-berlin.de>, loewis@informatik.hu-berlin.de (M.v.Loewis) writes:

> |> In the following program, it is not possible to create static (class)
> |> instances of a class with only private constructors. I suppose it is
> |> a general compiler error:

> |> A B::m(1);

> |> The problem is the last statement: I think it should be possible to create
> |> the m member of B somehow, since B is a friend of A, but all compilers I 
> |> tried complained ...
 
> "static.c", line 21: error: global scope cannot access A:A(): private member
 
> The Annotated C++ Reference Manual (ARM) is not explicit on this subject,
> but a sentence in section 9.4 ``Static Members'' is relevant ...
 
> 	Static members of a global class are initialized exactly like
> 	global objects and only in file scope.
 
> Thus, the initialization of B::m takes place in file scope, which does not
> have access to the private parts of A.

> It is not a bug; it is a feature.  ...

Actually a bug in the ARM.  This will probably be changed in the final
ANSI/ISO standard, since it was long ago changed in the working paper.
The initialization effectively takes place in the class scope.

> ... attempting to get changes considered by the ANSI C++ committee...
> Good luck!

Done!
-- 
 (This man's opinions are his own.)
 From mole-end				Mark Terribile

 uunet!mole-end!mat, Somewhere in Matawan, NJ
Newsgroups: comp.lang.c++
From: jonas@beppe.ericsson.se (Jonas Nygren)
Subject: How to detect dynamic allocated memory
Followup-To: comp.lang.c++
Reply-To: jonas@beppe.ericsson.se
Organization: Ericsson Telecom AB
Date: Wed, 22 Jul 1992 07:27:02 GMT


I am trying to implement a simple reference counting/smart pointer scheme
and would like to be able to use these smart references for both automatic 
and dynamically allocated instances. To do this I need to be able to identify
wether the instance was allocated via new or not. 

Is there a safe way to do this? I would like to do something similar
to the following in the top base class' constructor:

	if(allocated_via_new)
		new_allocation = TRUE;

The solution I am using currently is a signalling scheme via a static
variable which is set to TRUE in my overriden new and then reset
TO FALSE by the constructor after noting wether allocation was done via
new or not.

Is there a better way to do this?? 

Best regards

/jonas


Newsgroups: comp.lang.c++,gnu.g++.help
From: martin@oahu.cs.ucla.edu (david l. martin)
Subject: porting to g++ (from other "dialects")
Originator: martin@oahu.cs.ucla.edu
Organization: UCLA Computer Science Department
Date: Tue, 28 Jul 92 18:22:17 GMT

I am involved in a project in which we need to be able to use g++
(that is, the g++ component of the latest version of gcc) to compile*
existing source code which was developed for a variety of other
leading C++ compilers - including CFRONT, Borland, Zortech, and
Sabre.  I know there are still incompatibilities between g++ and
the other dialects, but I need to know just how bad they are.  For
example, if I take an average body of CFRONT-compilable code, what
percentage of it might be rejected by g++, in the sense of causing
a fatal error?

I would greatly appreciate the benefit of experience from anyone
who's ported to g++ from a different compiler.

(*To be more precise, I won't actually be generating executables from
the source code.  I'll be using g++ as a front-end to analyze
existing source code and produce an intermediate representation which 
describes it - essentially an attributed syntax tree.)

Thanks!

- Dave Martin
From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
Newsgroups: comp.lang.c++
Subject: Re: Renew?
Date: 30 Jul 92 16:54:47 GMT
Organization: MAXTAL P/L C/- University Computing Centre, Sydney

In article <23347@alice.att.com> ark@alice.UUCP () writes:
>In article <memo.547224@cix.compulink.co.uk> vadim@cix.compulink.co.uk writes:
>
>> I  agree, that a pointer to original object stored somewhere
>> else creates a dangerous situation, but this is still true even if the
>> 'operator renew' was built-in in the language. Renew and realloc should
>> be always used with caution.  
>
>If renew guarantees to the user that the copy constructor and
>destructor will be called for each object moved, that greatly
>ameliorates the situation.  It is then sufficient for the user to
>get those two functions right, or make them private (which would
>prohibit renew on objects of that class).

	Surely it is sensible that if renew is declared by the user,
that version of renew is used. Otherwise, renew is generated from the
copy constructor and destructor declared by the user.

	If the user declares neither the copy constructor or destructor,
then the generated renew need not correspond to physical
calls to the compiler generated copy constructor and destructor,
since in this case all three are generated by the compiler.


-- 
;----------------------------------------------------------------------
        JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
	Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
Xref: sparky comp.lang.c++:11337 comp.std.c++:916
From: rmartin@thor.Rational.COM (Bob Martin)
Newsgroups: comp.lang.c++,comp.std.c++
Subject: Re: Language extensions for run-time type identification
Date: 22 Jul 92 18:19:20 GMT
Followup-To: comp.lang.c++

shang@corp.mot.com (David (Lujun) Shang) writes:

|In article <14ft2uINNjh4@agate.berkeley.edu> jbuck@forney.berkeley.edu (Joe  
|Buck) writes:
| 
|> * the fact that it is trivial to force any class for which run-time type
|>   identification is needed to have a virtual function table (simply add
|>   a virtual destructor).
|>
|Adding something virtual just for the purpose that has nothing to do with it?

Posh!  Every class should have a virtual destructor.  It is insane not
to declare the destructor virtual.  There is only one, small,
exception to this rule, which has to do with structs placed in ROM...


--
+---Robert C. Martin---+-RRR---CCC-M-----M-| R.C.M. Consulting         |
| rmartin@rational.com |-R--R-C----M-M-M-M-| C++/C/Unix Engineering    |
|     (Uncle Bob.)     |-RRR--C----M--M--M-| OOA/OOD/OOP Training      |
+----------------------+-R--R--CCC-M-----M-| Product Design & Devel.   |
From: narayan@aravali.everest.tandem.com (Pankaj Narayan)
Newsgroups: comp.lang.c++
Subject: Any DATABASE Class out there ????
Date: 24 Jul 92 22:07:14 GMT
Reply-To: narayan@aravali.everest.tandem.com (Pankaj Narayan)
Organization: Tandem Computers Inc., Cupertino CA

PLEASE EMAIL YOUR REPLY !!

I need to define a simple database class that will keep data for
me. I will then setup inhertited classes from this one, one for managing 
my HELP stuff, and another for some data.

If you have a DATABASE class or something close that has member functions
to read/write data and store it in some manner, I'd love to get my hands 
on it.

PLEASE EMAIL ME YOUR REPLY AS I DON"T  WANT TO MISS IT.

Thanks !!!
Pankaj
 
------------------------------------------------------------------------
Pankaj Narayan			Email: narayan_pankaj@tandem.com
Tandem Computers			  
Newsgroups: comp.lang.c++,comp.std.c++
From: chip@tct.com (Chip Salzenberg)
Subject: Re: run-time type checking, freezing, and thawing
Date: Thu, 30 Jul 1992 19:39:37 GMT
Organization: TC Telemanagement, Clearwater, FL

According to jrobie@netmbx.netmbx.de (Jonathan Robie):
>chip@tct.com (Chip Salzenberg) writes:
>>But once you've frozen a C++ object into a dead array of bytes, it's
>>no longer a C++ object, so the C++ type system is no longer operative.
>
>RTTI is needed to properly freeze a C++ object into a "dead array of
>bytes" ...

Virtual functions are sufficient for freezing.

>... and to turn a "dead array of bytes" into a C++ object.

RTTI is of zero relevance to thawing.  It doesn't make this code work:

    int i;
    char *buf;
    read(fd, &i, sizeof(int));
    buf = new char[i];
    read(fd, buf, i);
    XXX *foo = thaw_arbitrary_object(buf, i);

For one thing, what is the XXX type? -- since there is no universal
base class for C++ objects, there is no valid candidate.  For another
thing, how can thaw_arbitrary_object know the complete set of classes
I might have written to the given file? -- it can't.

>It is also needed to follow references among objects in RAM.

I can do that without RTTI right now.

>RTTI and persistence are related enough that all of the major C++
>database systems use precompilers to get at it.

The mere fact that RTTI can be used for freezing proves neither (1)
that it is necessary for freezing, nor (2) that it is useful -- much
less necessary -- for thawing.
-- 
Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
   "Do Rush place weird subliminal backmasked messages in their songs to
 compel unwilling geeks to commit evil .sig atrocities?"  -- Dean Engelhardt
From: brett@ucrmath.ucr.edu (brett fleisch)
Newsgroups: comp.lang.c++
Subject: Textbook preference for c++
Date: 21 Jul 92 04:58:12 GMT
Distribution: na
Organization: University of California, Riverside

I am interested in obtaining your opinion concerning
possible textbooks to use to teach c++ to freshman undergrads.  
The freshman will have had either pascal or some C.  We assume 
little or no background and the students will NOT have had a 
course in data structures.

Please send your opinions, suggestions and input.
I will summarize answers.

Thank you for your possible input, in advance.


-- 
brett@cs.ucr.edu


Newsgroups: comp.lang.c++
From: edreas@nyx.cs.du.edu (Eric Dreas)
Subject: Printer Graphics
Organization: Nyx, Public Access Unix @ U. of Denver Math/CS dept.
Distribution: usa
Date: Wed, 22 Jul 92 15:36:49 GMT


Could someone please tell me where I can find information on printing
graphics output to HP Laserjet printers from Borland C++.

I only need to draw lines and output some text.
respond via email or post to this group.

*******   *******      Eric Dreas
 *****  *  *****  *    Frequency Coordinator
  ***  ***  ***  ***   Western Tele-Communications Inc.
   *  *****  *  *****  Internet: edreas@isis.cs.du.edu
     *******   ******* MCImail:  WTCIEngineering


Newsgroups: comp.lang.c++
From: pkt@lpi.liant.com (Scott Turner)
Subject: Re: const on pass by value
Organization: Liant Software Corporation
Date: Mon, 27 Jul 1992 17:45:00 GMT

mittle@watson.ibm.com (Josh Mittleman) writes:
|> pjcondi@lepton (Paul Condie) writes:
|> 
|> > Should pass by value arguments be declared as "const" for
|> > good coding style?  Or is that nit picking?

It's not a matter of declaration style, because the declaration must agree
with the function definition.

|> For scalar arguments, it doesn't really matter: The user can see that the
|> argument is passed by value, so he doesn't care whether or not it is const.
|> If you find it convenient, make it a const.
|> 
|> For struct or class arguments, it may make a difference, and it is
|> important to tell the user whether you will change the argument or not.
|> Use const appropriately.

For struct or class arguments passed by value, it's the same as scalars.
Whether you change the by-value parameter or not, the parameter is destroyed 
when the function returns, so it doesn't matter to the caller.
--
Prescott K. Turner, Jr.
Liant Software Corp. (developers of LPI languages)
959 Concord St., Framingham, MA 01701 USA    (508) 872-8700
UUCP: uunet!lpi!pkt                          Internet: pkt@lpi.liant.com
From: han@lipari.usc.edu (Jung-Hyun Han)
Newsgroups: comp.lang.c++
Subject: wow!! C++ interface
Date: 28 Jul 1992 07:13:36 +0100
Organization: University of Southern California, Los Angeles, CA
Distribution: world
NNTP-Posting-Host: lipari.usc.edu

I have been in the dark for 5 days!! help me!!

I am linking C++ and FORTRAN.
The makefile I made is as follows:

SUNLIBS = -L/usr/old -lcore77 -lcore -lsunwindow -lpixrect 
X11LIBS = -L/usr/usc/X11/lib -lXaw -lXt -lX11
FORLIBS = -lF77 -lI77 -lU77 
LIBS =  $(FORLIBS) $(SUNLIBS) $(X11LIBS) -lm

P2OBJS = .....see below......

p2.exe: main.o solid.o
	CC -Bstatic -s -O -o p2.exe main.o solid.o $(P2OBJS) $(LIBS) 
	chmod a+x p2.exe
main.o: main.c
	CC -c main.c
solid.o: solid.c solid.h
	CC -c solid.c

where P2OBJS are FORTRAN object files and libraries which have routines
called by main.c and solid.c

When I run the above makefile, I got linking error as follows:
undefined symbol:
	___vtbl__4face

1) I do NEVER write the above symbol in my source code.
2) I got intermediate C file, solid..c thru example>CC +i -c solid.c.
   (You know CC always converts C++ into C, and works on C.)
   Then I found solid..c has ___vtbl__4face!!!!!!
   So I believe C++ compiler added the above undefined symbol ___vtbl__4face,
   when it converts C file into C++ file.
   
How can I resolve this error?
CC should have included some library which defined ___vtbl__4face.
I cannot figure out why CC did not do so.
I examined all I can do, but I failed to figure out......
Please help me!!


Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re: Language extensions for run-time type identification
Date: 23 Jul 92 17:59:44 GMT
Organization: Microsoft Corporation

In article <23284@alice.att.com> ark@alice.UUCP () writes:
>In article <rmartin.711829160@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
|
|> Posh!  Every class should have a virtual destructor.  It is insane not
|> to declare the destructor virtual.  There is only one, small,
|> exception to this rule, which has to do with structs placed in ROM...
|
|How about classes associated with small objects, such as Complex and Point?

Exactly!  How ABOUT them?

They OUGHT to be ROMABLE.  They OUGHT to be guaranteed to be const.
A programmer writing:

const complex imag_pi(0, pi);

OUGHT to be able to assume that his/her constant IS constant, and generates
the quality of code expected of constants.

BUT, none of this is true given the committee's decision to support
"Humpty Dumpty" const.

Newsgroups: comp.lang.c++,comp.std.c++
From: chip@tct.com (Chip Salzenberg)
Subject: Re: Downcasting and mortal sin (was run-time type checking)
Date: Tue, 28 Jul 1992 17:14:17 GMT
Organization: TC Telemanagement, Clearwater, FL

According to jrobie@netmbx.netmbx.de (Jonathan Robie):
>I'm confused.  I have two animals, and I place them in a cage.
>Who knows where these animals come from or what kind they are--
>my classes may not have produced them.

This is an important point: Further derivations of Animal may occur
after all of "our" code is written and stashed in a library.

>Now the program needs to decide if these animals should mate.

No!

The program may decide whether it _wants_ the animals to mate.  But as
for deciding the results of such an attempt, only the animals know!
This fact is a consequence of the "who should know" principle: animals
may make mating decisions based on factors that I can't imagine ahead
of time.

Therefore you need this:

    virtual boolean Animal::can_mate_with(const Animal&);

Then there are can be any number of virtual member functions that each
implementation of SomeAnimalType::can_mate_with() may use to determine
if any given OtherAnimalType is suitable for mating.  Some classes
derived from Dog may be more picky than others, for example.

Presto!  No RTTI, and it still works.

Remember the golden rule of software interfaces:

   Never try to predict success or failure of an operation.
   Instead, try it and see what happens.

-- 
Chip Salzenberg at Teltronics/TCT  <chip@tct.com>, <73717.366@compuserve.com>
   "Do Rush place weird subliminal backmasked messages in their songs to
 compel unwilling geeks to commit evil .sig atrocities?"  -- Dean Engelhardt
Newsgroups: comp.lang.c++
From: cflatter@nrao.edu (Chris Flatters)
Subject: Re: reference to C++ assertion macro packa
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Sun, 26 Jul 1992 21:13:17 GMT

In article 18998@taumet.com, steve@taumet.com (Steve Clamage) writes:
>maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
>
>>	Does anyone have details of the proposed assertion
>>facility for C++?
>
>The <assert.h> facility from Standard C is part of C++.  I have not seen
>any proposals for anything else.  If in particular you mean something
>like the pre- and post-conditions for Eiffel classes, I haven't seen any
>discussion of them.

Has there been any discussion about adding something along the lines of
the Assert() template from page 419 of Bjarne's new testament as a complement
to or replacement for the ANSI C assert() macro?  Raising an exception seems
to be rather more in the spirit of C++ than forcing an abort.

	Chris Flatters
	cflatter@nrao.edu
From: gg10@prism.gatech.EDU (GALLOWAY)
Newsgroups: comp.lang.c++
Subject: Bug in Sun C++ Demangler
Date: 23 Jul 92 20:58:19 GMT
Organization: Georgia Institute of Technology

I have found a problem with the demangler used in Sun's SC1.0 C++ 2.1
(really AT&T cfont 2.1.03).  The bug may not be in cfront itself, and only in
utilities like nm++, dem, c++filt, etc.

A source file to reproduce the error follows:

> cat foo.cc
void foo(double x1, double y1, double z1, int c1,
         double x2, double y2, double z2, int c2)
{
}

> CC -c foo.cc
"foo.cc", line 1: warning:  x1 not used
"foo.cc", line 1: warning:  y1 not used
"foo.cc", line 1: warning:  z1 not used
"foo.cc", line 1: warning:  c1 not used
"foo.cc", line 2: warning:  x2 not used
"foo.cc", line 2: warning:  y2 not used
"foo.cc", line 2: warning:  z2 not used
"foo.cc", line 2: warning:  c2 not used

> nm++ foo.o
00000000 T   foo(double,double,double,int,double,double,double,double)
             [_foo__FdN21iN31T4]

>> dem _foo__FdN21iN31T4
_foo__FdN21iN31T4 == _foo(double,double,double,int,double,double,double,double)

>> echo _foo__FdN21iN31T4 | c++filt -v
Demangler Version 1.5, Date 7/27/88
foo(double,double,double,int,double,double,double,double) 

The last argument of type "double" should be an "int".  The "T4" in the
mangled name says "same type as parameter 4" which is indeed an "int".
There are several other similar functions which all demangle incorrectly.

I have only posted this to comp.lang.c++.  Could someone let me know how, or
send this on to the proper people at Sun and/or AT&T?

Greg Galloway (gg10@prism.gatech.edu)
Georgia Tech Research Institute/Electro-Optics Physical Sciences Laboratory