HDTenEightyP/NetNews huggingface dataset:
From: oper7@ee06.ncu.edu.tw (Anthony Shih Hao Lee)
Subject: BC++, call member func in inline-assembly code
Organization: Dep. of EECS, National Central University, Chungli, Taiwan, R.O.C.
Date: Tue, 5 Jan 1993 07:45:09 GMT

Hi, all BC++ users:
I recently write some progs for drawing, but it happened bad things:
Suppose that I have declared a static class function:
class test {
	public:
		static void test ( void ) ;
} ;
and suppose that it's internal identifier is :
@test@test$xxx

then I put the following statement in my another program:

#pragma inline			// this will made BC++ IDE to call TASM
_asm	extrn	@test@test$xxx:far
_asm	call	far ptr @test@test$xxx
These two lines will passed for TASM assembling...
TLink will report that there is fixup error in that module (which include
the two in-line asm line)
i.e., TASM do not produce the correct assembly code...
Can you tell me what happened?
Thanks
tony
-- 
>>> Anthony Li <Li3, Shih4 Hao2><Li:fruit's Name><Shih:Scholar><Hao:Hero>   <<<
<<< Institute of CSEE, National Central Univ, Chungli, Taoyuan, Taiwan, ROC >>>
>>> Internet:	oper7@mbox.ee.ncu.edu.tw	 oper2@ncuee.ncu.edu.tw	    >>>
Newsgroups: comp.lang.c++
From:  michael@ovsen.msk.su (Michael Y. McAlcin)
Subject: Re: Static global initialization outside of main() legal?
Date: Sat, 9 Jan 1993 15:05:10 GMT
Reply-To: michael@ovsen.msk.su
Organization: Ovsen Ltd.

In comp.lang.c++ in <34727@sales.GBA.NYU.EDU>
wlee@sales.GBA.NYU.EDU (Wai-Shing Lee) writes:

>
>static int *pointer ;
>static int initialized=findvideomemory() ;
>
>static int makepointer(void)
>{
>       pointer=(int*)calloc(10, sizeof(char)) ;
>}
>
>I've traced it and sure enough makepointer() is called and pointer is assigned
>a value before main() even starts.  Is the portable, legal.  I didn't look
>to hard in my C++ book, but there weren't any obvious answers.  Is this
>C++, C or something I should stay away from?
>

See ARM 8.4

Michael Y. McAlcin
Ovsen Group Ltd. of Russia


Xref: sparky comp.lang.c++:19039 comp.lang.c:19598
From: heiniw@eebsun1.eeb.ele.tue.nl (Heini Withagen)
Newsgroups: comp.lang.c++,comp.lang.c
Subject: Problems with gcc/g++ and profiling
Date: 12 Jan 93 15:37:52 GMT
Followup-To: comp.lang.c++
Organization: Electronic Circuit Design Group, Eindhoven University of Technology, The Netherlands



I am having trouble with gcc/g++ 2.2.2 compiling programs with -pg
options for profiling. I have been looking what g++ actually does
during compilation/linking (-v option) and compared this to 'cc' (on 
a SUN Sparc).

It seem that g++ is linking the wrong libraries which do not contain
the right function for profiling. When I try to make a seperate call
to the linker with the same libraries substituded as with 'cc', I get
a long list of 'Undefined' names which look like 'LBE??' and 'LBB??'.


Does anyone know the answer to my problems ?? Please help me, because
I am getting quite desperate.


Thanks very much in advance,

Heini Withagen
Department of Electrical Engineering EH 9.29
Eindhoven Technical University
P.O. Box 513
5600 MB Eindhoven
The Netherlands
Phone: 31-40472366
Fax:   31-40455674
E-mail: heiniw@eeb.ele.tue.nl
Newsgroups: comp.lang.c++
From: kkt@philabs.philips.com (Kim-Kiat Tan)
Subject: TDW & 24x
Organization: Philips Laboratories, Briarcliff, New York
Date: Thu, 7 Jan 1993 18:57:59 GMT

	The TDW display is messed up when running 1024 mode at 256 colors and
800 mode at 256 colors, so I have to use the 800 mode at 32k color for it to
work right. But I would like to use 1024 mode, any one knows any patches for
that ?
	thanks.

Newsgroups: comp.lang.c++
From: ennisj@tt.com (Jay Ennis)
Subject: Base Class Pointers to Derived Class Objects. Is this Possible?
Organization: Telecommunications Techniques Corporation, Germantown MD
Date: Mon, 11 Jan 1993 15:43:39 GMT

I am trying to create an array of base class member pointers to a group of
derived class objects.  It strikes me as a perfectly legal thing to do.

When compiling the attached sample, Borland C++ 3.1 returns the error message
    "Cannot convert 'DERIVED_CLASS OBJECT_DB::*' to 'BASE_CLASS OBJECT_DB::*'"
indicating to me that iheritance of the base class isn't possible in this case.

Does anyone have any suggestions, ideas or workarounds?  Is this a bug?
Any assistance is most appreciated.  Please reply by e-mail.

*********************** Sample *****************************

class BASE_CLASS {
   public:
       virtual void Function(void) = 0;
};

class DERIVED_CLASS: public BASE_CLASS {
    public:
	void Function(void);
};

void DERIVED_CLASS::Function(void) {}

struct OBJECT_DB {
    DERIVED_CLASS	Item1;
};

BASE_CLASS OBJECT_DB::*BC_Array[] = {
    &OBJECT_DB::Item1
    };

void main(void) {
    OBJECT_DB	ObjectDB;
    ObjectDB.*BC_Array[0].Function();
}
-- 
Jay Ennis 
ennisj@tt.com               "The sea is your wife, your ship your mistress,
                                  and the land a treacherous whore"
From: jamshid@emx.cc.utexas.edu (Jamshid Afshar)
Newsgroups: comp.lang.c++
Subject: Re: template constructor specialization (question)
Date: 12 Jan 1993 15:27:00 -0600
Organization: The University of Texas at Austin, Austin, Texas
Reply-To: jamshid@emx.utexas.edu
NNTP-Posting-Host: emx.cc.utexas.edu
Summary: a specialization can't itself be a template; suggestions?

In article <DSCHIEB.93Jan5130012@muse.cv.nrao.edu> dschieb@muse.cv.nrao.edu (Darrell Schiebel) writes:
>	template<class t> class id {
>	  id();}
>	template<class t> class templ {};
>
>And now I want to write a specialized constructor for "id":
>
>	template<class t> inline id<templ<t> >::id() {};
>
>What is the correct syntax for this?? I want a constructor which will be
>called for any instantiation of "templ".

Unfortunately I don't think there is a solution.  A specialization
cannot itself be a template.  You may only write specializations for
specific instances of 'templ'.

	inline id<templ<Foo> >::id() {}
	inline id<templ<Bar> >::id() {}
	
I ran into this same problem when I tried to use templates to decrease
the number of overloaded operators I write for my classes.  I wrote a
operator '+' template function which assumes the class defines
operator '+=':

	template<class T>
	T operator+(const T& a, const T& b) { T r(c); c+=b; return c; }

While this works for many classes and saves lots of typing, some
classes either have different addition rules or addition can be
implemented more efficiently than the above code.  Unfortunately
the following doesn't work:

	template<class T>
	T operator+(const Matrix<T>& a, const Matrix<T>& b)
	{ /*...*/ }

	Matrix<double> x,y,z;
	z = x+y;	// error: ambigous (T==Matrix<double> or T==double?)

Allowing this would require some kind of template type overloading
rules.  Has anyone already thought this through?  Is it possible to
come up with general rules which would choose the latter operator+()?

Jamshid Afshar
jamshid@emx.utexas.edu

Newsgroups: comp.lang.c++
From: dwr@cci632.cci.com (Donald W. Rouse II)
Subject: Re: "type safety" deemed essential
Organization: [Computer Consoles, Inc., Rochester, NY
Date: Tue, 12 Jan 1993 18:05:48 GMT

In article <TMB.93Jan6220042@arolla.idiap.ch> tmb@idiap.ch writes:
> [...]
>Unfortunately, C++ still lacks some kind of "tagged union type",
>"typesafe union type", or, if you are a Pascal fan, a "variant record
>with runtime type checking". Those kinds of datatypes are useful in
>many applications. A common example is that of a binary tree with
>different node and leaf types.
>
>There are workarounds, but they either use a lot more memory (using a
>"struct" instead of a "union"), or they aren't type-safe (pointer
>casts or C-style unions). And with any such workaround in C/C++, you
>are missing out on useful compile time diagnostics and optimizations
>that would be possible if the feature was supported.
>
>					Thomas.

True, but the type-unsafe stuff can be encapsulated:

class i_or_f
	{
	int isint;
	union { int i; float f; };
	public:
		i_or_f (int ii) { isint = 1; i = ii; }
		i_or_f (float ff) { isint = 0; f = ff; }
		int geti (int* ip) { if (isint) *ip = i; return isint; }
		int getf (float* fp) { if (!isint) *fp = f; return !isint; }
	};
From: exumart@exu.ericsson.se (Martina Hughes,xt-df,0634)
Newsgroups: comp.lang.c++
Subject: Seeking C++ Course Recommendations
Date: 11 Jan 93 16:58:58 GMT
Reply-To: exumart@exu.ericsson.se
Distribution: dfw
Organization: Ericsson Network Systems
X-Disclaimer: This article was posted by a user at Ericsson.
              Any opinions expressed are strictly those of the
              user and not necessarily those of Ericsson.

Can anyone recommend some good C++ courses around the DFW area. 

Thanks in advance / Martina H.
From: cosc18op@menudo.uh.edu ( Stephen)
Newsgroups: comp.lang.c++
Subject: FOR SALE: Turbo C/C++ compiler
Date: 12 Jan 1993 16:41:27 -0600
Organization: University of Houston
NNTP-Posting-Host: menudo.uh.edu

I have a Borland Turbo C/C++ compiler for ms-dos that I want to sell.
Media is 3.5" disks. Asking price is $60 (shipping included). However, I
am willing to negotiate. Package is in good condition and includes original
box with all documentation but no registration card. If you are
interested, I can be reached at :  cosc18op@menudo.uh.edu

Steve
From: tamari@bimacs.BITNET (tamari zvi)
Newsgroups: comp.lang.c++
Subject: Turbo C++ version 1.01 cout problem
Keywords: c++,cout
Date: 4 Jan 93 14:01:42 GMT
Organization: Math & CS, BarIlan U, Ramat-Gan, Israel


     I have started learning C++, and I have a problem linking program with
     cout.

     my program looks as follows :

     #include<iostream.h>
     main()
     {
       cout << "Hello\n";
     }

The linker gives the following messages :


Linker warning: ios::stdioflush conflicts with module FSTREAM in module HELLO.C
Linker error: Undefined symbol ostream(const char far*,const char far* ) in module HELLO.C



   I will be greatful, and God will bless you I you can sort out this problem
   for me.

                                        Thanks in advance,
                                                Zvi Tamari.


--
Name : Zvi Tamari

E-Mail Addresses : BitNet   : tamari@bimacs.bitnet
                   InterNet : tamari@bimacs.cs.biu.ac.il

Address : 3   Hameiri  st.
          Ramat Gan 52 651
          ISRAEL            Telephone : +972-3-340169
                            Fax       : +972-3-6910525
Date: Thursday, 7 January 1993 17:10:06 EST
X-Mailer: TMail version 1.14R
From: "Tim Triemstra" <empath@ais.org>
Organization: Empath Software
Subject: STRPP Class
Newsgroups: comp.lang.c++
Distribution: world

I downloaded from the FTP mirrors a file called STRPP which is a class
library for strings.  The library looks pretty good, but unfortunately
it won't compile correctly under Zortech C++ 3.04.  I'm hoping that
the 3.1 update for Zortech will fix that.  However, the current error
isn't a source-code error from what I can tell.  It is an internal Zortech
error.  I was curious if anyone has worked with this library (or can 
recommend another good C++ String Class) and Zortech C++.  I'm really
open to any other string library as long as it is shareware/freeware.
But, if anyone has worked with this one and Zortech I'd love to get it
working.

Or even, has anyone gotten the String Class from MFC (MicroSoft Foundation
Class) to work under Zortech?

Thanks alot.
Tim.


-------------------------------------------------------
| When the end comes, there will be two men standing: |
|   Me, and the guy I gotta kill.   - Gosh I'm EVIL   |
------ Tim Triemstra ------------- empath@ais.org -----
From: tmb@arolla.idiap.ch (Thomas M. Breuel)
Newsgroups: comp.lang.c++
Subject: Re: "type safety" deemed essential
Date: 7 Jan 93 06:00:42 GMT
Article-I.D.: arolla.TMB.93Jan6220042
	<726346306snx@trmphrst.demon.co.uk>
Reply-To: tmb@idiap.ch
Distribution: world
Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
	Perceptive)
NNTP-Posting-Host: arolla.idiap.ch
In-reply-to: nikki@trmphrst.demon.co.uk's message of Wed, 6 Jan 1993 11:51:46 +0000

In article <448@genie.UUCP> roger@genie.UUCP (Roger H. Scott) writes:
> ... [W]ho has written a non-trivial commercial C++ 
> application *without* making significant use of either type casting [(T *)]
> or run-time type checking [Bar *bar_p = foo_p->asBar();]?  

In article <726346306snx@trmphrst.demon.co.uk> nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
> [suggesting that some 31000 lines of code he has written without
> using these features are "non-trivial"]

Unfortunately, C++ still lacks some kind of "tagged union type",
"typesafe union type", or, if you are a Pascal fan, a "variant record
with runtime type checking". Those kinds of datatypes are useful in
many applications. A common example is that of a binary tree with
different node and leaf types.

There are workarounds, but they either use a lot more memory (using a
"struct" instead of a "union"), or they aren't type-safe (pointer
casts or C-style unions). And with any such workaround in C/C++, you
are missing out on useful compile time diagnostics and optimizations
that would be possible if the feature was supported.

					Thomas.
Newsgroups: comp.lang.c++
From: pf@bilbo.bio.purdue.edu (Paul Furbacher)
Subject: Re: TVISION:cmQuit and clearEvent :(
Followup-To: comp.lang.c++
Organization: Purdue University
Date: Sun, 10 Jan 1993 03:48:51 GMT

My mailer is broken this weekend: hopefully you'll see this
even though you specifically request e-mail replies.

In article <1993Jan9.100350.22034@sparc4.ncu.edu.tw>, oper7@ee05.ncu.edu.tw
(Anthony Shih Hao Lee) wrote:

> [when] I quit my TV app, TApplication seems not to destroy all
> other objects which has created for my application.

This is true, for objects such as collections.  You have to 
handle the disposing of objects which are not inserted into
either the application object or the desktop.  To do this, 
you have to override the destructor member function of the 
Application class.

> I must actively to broadcast cmQuit message to those windows
> which has exposed on the desktop, so that they could finish their job.

No. Since you own BC++&AF, look up the source for TGroup, the 
ancestor of among other things, TDesktop, TProgram and TApplication.
You will see that calling TApplication.Done (Pascal flavor here, if you 
don't mind, = ~TApplication) you are eventually calling 
TGroup.Done.  And TGroup.Done iterates through its linked list
of inserted subviews -- be they editor windows, calculators, 
memos, ascii tables, whatever -- and calls their destructors.
Therefore, objects inserted into TApplication and TDesktop
descendents are properly disposed of, assuming any descendent
destructors you may have written for any of the subviews are 
deallocate properly. 

> 1.
> in fact, TApplication should broadcast some useful message such as
> cmClose, cmQuit to announce windows on the desktop.
> and, cmQuit message for a TApplication seems not similar to other
> evCommand.
> 2.
> Due to cmQuit is the most important message which all
> handleEvent should take response, user's TApplication::handleEvent
> could not use clearEvent, and must pass this message to it's parent
> handleEvent. am I wrong?

Again, this is where it is up to you to create a descendent of
TApplication and modify the destructor and possibly the HandleEvent()
member function.  Remember that if you want your descendent 
to get first crack at handling an event, place your modifying
code ***before*** the call to the ancestor's method, especially
in the case where you know the ancestor clears the event.

And it is up to you to design the messaging between objects --
the application framework foundation classes cannot anticipate
all your special messaging needs.  This is what inheritance is
all about: creating descendents whose behavior is evolved to 
a greater degree of sophistication than the ancestors'.

Hope this is clear enough for you to make further progress.

PF
Newsgroups: comp.lang.c++
From: berczuk@space.mit.edu (Steve Berczuk)
Subject: Re: Preventing inheritance
Organization: MIT Center for Space Research
Date: Mon, 11 Jan 1993 19:55:03 GMT

In article <1iqtnpINN283@news.cerf.net>, hlf@nic.cerf.net (Howard Ferguson) writes:
|> 
|> If I create a class which I am supplying to other users, how do I
|> make sure that they do not inherit from it ever. I could overload new
|> and check the size of the object that is being allocated, but there
|> are two catchs. The first minor one is that this is a run-time check,
|> and it would be far preferable to catch this sort of thing at compile
|> time. More seriously, they could over-ride the new operator and by-pass
|> the check.
|> 	yours totally paranoid,
|> 			hlf
Umm, why would you want to do this?

It seems like soing this sort of thing defeats the purpose fo using c++; I can
understand not wanting to "support" other users who inherit the class, but that
might be best approached by some sort of documentation (eg comments in the header
to the effect of "this class supports some wierd protocols that subclasses need to
enforce, subclass at your own risk"). 

It is probably better to just ensure that instances of the class are  always in a
consistent state.

Is there are really valid reason (aside from paranoia) that one would want to write
a class that could not be subclassed?





-- 
Steve Berczuk			berczuk@mit.edu		
MIT Center for Space Research	(617) 253-3840

Newsgroups: comp.lang.c++
From: dschieb@muse.cv.nrao.edu (Darrell Schiebel)
Subject: template specialization (Not up to task, Suggestions?)
Organization: National Radio Astronomy Observatory
Distribution: comp
Date: Wed, 6 Jan 1993 14:41:10 GMT


I posted a question yesterday about specialization of a constructor
based on a template:

	template<class t> class id {
	public:
	  id();
	};

	template<class t> class users {};

I would like to specialize the constructor of "id" for all "users", something
along the lines of:

	template<class t> inline id<users<t> >::id() {}

However, I've either not been able to get the syntax right or this is not
currently possible with cfront 3.0 compatible compilers. Does anyone
have any suggestions, or work-arounds?? Anyone ever tried this?? Below is
my test file of variation I've tried, along with the error messages.

					Thanks for any help,
					Darrell Schiebel
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

template<class t> class id {
public:
  id();
};

template<class t> class users {};


//line 12: qualifier parameters must match the template formal parameters
#if T1
template<class t> inline id<users<t> >::id() {}
#endif
//line 16: template users argument mismatch, the template formal: t required a type actual parameter
#if T2
template<class users<t> > inline id<users<t> >::id() {}
#endif
//line 21: empty template parameter list
//line 21: type expected for t -- did you misdeclare a template?
#if T3
inline id<template<class t> users >::id() {}
#endif
//line 26: empty template parameter list
//line 26: type expected for t -- did you misdeclare a template?
#if T4
inline id<template<class t> users<t> >::id() {}
#endif
//line 31: empty template parameter list
//line 31: type expected for t -- did you misdeclare a template?
#if T5
inline id<template<class t> class users >::id() {}
#endif
//line 36: empty template parameter list
//line 36: type expected for t -- did you misdeclare a template?
#if T6
inline id<template<class t> class users<t> >::id() {}
#endif
//line 43: syntax error -- did you forget a ';'?
//line 43: sorry, not implemented: forward declaration of a specialized version of template users
//line 43: class   users <any > -- did you mean a general forward declaration of the template?
//line 43: if so, use:  template <formal-parameters> class users;
#if T7
typedef userstype template<class t> class users<t>;
#endif
//line 47: syntax error -- did you forget a ';'?
#if T8
typedef userstype template<class t> class users;
#endif


main(){}
From: pete@borland.com (Pete Becker)
Newsgroups: comp.lang.c++
Subject: Re: Template-instantiation fails with references
Date: 5 Jan 93 18:23:15 GMT
Organization: Borland International
Originator: pete@genghis.borland.com

In article <stefans.726234949@bauv106> stefans@bauv.unibw-muenchen.de (Stefan Schwarz) writes:
>Hi all,
>
>just came to a serious problem with templates. 

	One useful technique for understanding problems with templates is to
write the "same" code without using a template.

>Simple code:
>
>#include <iostream.h>
>template <class T> class Collection
>{
>private:
>        T *_buffer;
>        T _endtag;
>public:
>        Collection (size_t size, T endtag) {
>                _buffer = new T [size];
>                _endtag = endtag; }
>};
>
>class Foo
>{
>};
>

	class FooRefCollection
	{
	private:
		Foo& *_buffer;
		Foo& _endtag;
	public:
		FooRefCollection( size_t size, Foo& endtag ) {
			buffer = new Foo&[size];
			_endtag = endtag;
		}
	};

	This should produce the same error messages.  There are two problems
here.  First, a reference must have an initializer.  _endtag does not have an
initializer, only an assignment to it.  Second, it is not possible to create
an array of Foo&.
	The first problem can be solved by initializing _endtag in the
initializer list (  FooRefCollection( Foo& endtag ) : _endtag(endtag) {}
	The second can't be solved without redesigning the class.
	-- Pete
Xref: sparky comp.lang.c++:18672 comp.lang.c:19187 comp.software-eng:5192 comp.object:4702
Newsgroups: comp.lang.c++,comp.lang.c,comp.software-eng,comp.object
Subject: Need pointers to evaluation of bug finding software
From: smp@cerc.wvu.wvnet.edu (Shailesh M. Potnis)
Date: Mon, 4 Jan 1993 15:19:11 GMT
Followup-To: poster
Organization: Concurrent Engineering Research Center

I would like have some review/evaluation/survey of bug finding software
available in the private/public domain.  Almost all of our bug finding needs
are in the code written in C++/C language.  We use C compilers provided by
the system vendors and CenterLine C and C++ development environment.  

	All comments and suggestions are highly appreciated.

	Thanks in advance.

	Shailesh



-- 
Shailesh Potnis, Associate	|Concurrent Engineering Research
Member of Technical Staff	|Center, West Virginia University
Newsgroups: comp.lang.c++
From: chw@bellcore.com (Charlie Woloszynski,MRE 2J-278,8295228,,27143)
Subject: C++ ARM
Reply-To: chw@bellcore.com
Organization: Bellcore
Date: Mon, 11 Jan 93 14:58:03 GMT


Can anyone tell me how to get access to the ARM?



Charlie Woloszynski
-----------------------------------------------------------------------------
Charlie Woloszynski   			MTS - ATM Technology and Applications
Bellcore 				+01 201 829 5228 (voice)	
Room MRE 2J-294				+01 201 829 5887 (fax)
445 South Street Box 1910		chw@bellcore.com (SMTP) 
Morristown, NJ 07960-1910  USA		
-----------------------------------------------------------------------------

Newsgroups: comp.lang.c++
From: mbersohn@alchemy.chem.utoronto.ca (M. Bersohn)
Subject: A KIND OF RESTRICTED ACCESS TO MEMBER FUNCTIONS
Originator: mbersohn@plumbum.chem.utoronto.ca
Organization: University of Toronto Chemistry Department
Date: Tue, 12 Jan 1993 10:09:13 GMT

<I would like to have a class that has some public methods that can
<only be used by a certain group of classes.
<Lets call this class A, and I want B,C,D &E to be able to use the
<public methods on A. (no problem so far)
<However, I don't want classes X, Y, &Z to be able to use the methods,
<nor any other similar classes added in the future.
<I don't want B,C,D &E to access the private data of A, so I can't make
<them friend classes.  A,B,C,D, &E aren't in the same heirarchy, so I
<can't use inheritance to have a solution to the problem.
<What I would like to be able to do is say that the public methods of A
<are only public to a certain group of classes, and private to all
<others.
<Any ideas?

<post, or reply to ralph@dci.pinetree.org
How about giving your public methods in A an extra
argument? This argument would identify the calling class.
At the beginning of the member functions in A you will
check the identifier and if it does not correspond to
classes B,C,D, or E you will exit or exception-handle or
whatever.