HDTenEightyP/NetNews huggingface dataset:
From: hansen@myria.cs.umn.edu (David Hansen)
Subject: Re: Is this a compiler bug?
Organization: University of Minnesota
Date: Wed, 16 Dec 1992 01:27:47 GMT

In article <KANZE.92Dec14211143@slsvdnt.us-es.sel.de>, kanze@us-es.sel.de (James Kanze) writes:
|> Although the parts you quote are from the comments, and as such, not
|> strictly part of the standard, in section 4.8, it explicitly says that
|> "A constant expression that evaluates to zero is converted to a
|> pointer to member.  It is guaranteed that this value will produce a
|> pointer to member distinguishable from any other pointer to member."
|> Which is exactly the phrasing used when defining a NULL pointer.
|> 
|> So you do have NULL pointers to members.

I was hoping that was in there somewhere.  I was in a hurry, and couldn't 
find it.  Thanks for locating it for me...

					-=Dave
Newsgroups: comp.lang.c++
From: morss@ssd.kodak.com (Charlie Morss)
Subject: File protection on iostreams
Organization: Ektron, a division of Eastman Kodak, Co.
Date: Tue, 15 Dec 92 21:20:53 GMT


According to Strus. the header files for fstream.h in the
third arguement for the open call specifies the
file protection mode, as in chmod, for the file
you are creating. When I use a protection mode of
664, when the file is created it has a protection
mode of 644, which is the default. Is there a 
reason that the file protection mode is not
done correctly. Here is an example:

#include "fstream.h"

fstream filestream;
int     iosmode = ios::out|ios::noreplace;

filestream.open("file.ext",iosmode,0664);
...

The file "file.ext" does not get created with
protection 664, it gets created with 644.

If I do fchmod(descp,0664) the protection
is changed to what I want. But I shouldn't
have to do this!


Also, even if I get the file created correctly
I have troubles opening the file under a different
user name who is in the same group. The open just
fails as if the protection is wrong. (If the protection
is manually changed to 666 it opens fine).

What am I missing here?
Please help!!!

Charlie 

P.S. Sun Sparc II w/ Sun OS 4.1.1 and Sun C++
    
P.P.S. If I do "normal" opens (old fashion C) 
	   everything works fine!!
-- 
-----------------------------------------------------------------
Charlie Morss                               Voice: (716) 726-5461
morss@eksignal.kodak.com                      Fax: (716) 726-4850 
-----------------------------------------------------------------
Newsgroups: comp.lang.c++
From: gopi@enuxha.eas.asu.edu (Bulusu Gopi Kumar)
Subject: IS C++ a language for the "average programmer"
Organization: Arizona State University, Tempe, AZ
Date: Sat, 12 Dec 1992 23:44:07 GMT


I have been following a lot of articles on this group for sometime now.
There seems to be a lot of confusion on a large number of topics in c++
among the programmers! Is this because of the fact that c++ is a relatively
new language ? Is it because c++ is becoming more and more complex by the
addition of features like "TEMPLATES". Infact even after 2 years of reading
and reading (though without much of project experience) I often get confused
with some combinations of c++ features.Is it that "complex" projects can be
handled by only complex languages ? Any takers for this question ? 

There used to be a language called PL/1 . . .

Bulusu Gopi Kumar
--
===============================================================================
Bulusu Gopi Kumar                               gopi@enuxha.eas.asu.edu
===============================================================================
Newsgroups: comp.lang.c++
From: euamts@eua.ericsson.se (Mats Henricson)
Subject: Lint++ (Re: Give me safe C++)
Reply-To: euamts@eua.ericsson.se
Organization: Ellemtel Telecom Systems Labs, Stockholm, Sweden
Date: Wed, 16 Dec 1992 12:01:37 GMT

In article 724462415snx@trmphrst.demon.co.uk, nikki@trmphrst.demon.co.uk (Nikki Locke) writes:
#I rather like the idea of a restricted subset of C++ which disallows 
#everything dubious, provided, of course, you can use the full power of the
#language occasionally (maybe in separate modules, or inside some #pragma 
#section). That way I get protected from my own mistakes, but I can still 
#work round any shortcomings in the language, the machine architecture or 
#the design.
#
#How about a -safe-c++-only switch to the compiler :-)

I think a better approach is a programmable Lint++, since different users
and different companies have different views of what is dangerous or not.
As long as you know why Lint++ gives you all these warnings, you probably
know what you are doing.

Mats Henricson
Ellemtel Telecom Systems Labs
Stockholm
Sweden
From: andy@federation.gatech.edu (Andy Register)
Newsgroups: comp.lang.c++
Subject: Re: Can't I initialize a dynamically allocated object in its constructor?
Date: 18 Dec 92 00:50:52 GMT
Organization: CERL-EE, Georgia Institue of Technology

In article <1992Dec17.205113.1180@IRO.UMontreal.CA> laviers@IRO.UMontreal.CA (Cocotte Minute) writes:
>Hello,
>
>I have the following problem.
>
>a temporary vector is constructed to put the result of v1+v2 .
>If there is no initialization in the constructor , it works just fine, 
>if there is initialization (here, to [-1,-1,-1...]), we seem to loose the value 
>of v1+v2... why???
>

You are almost there, you have failed to include a copy constructor 
that does a deep copy, i.e.

Vector::Vector(const Vector& v);
You have to allocate memory, assign values, blah, blah blah.

Also, I like to have the following syntax for my operator=

const Vector& Vector::operator=(const Vector& v);

The first const means that folks cannot a=b=c=... and 
screw up assignment.  Coplien or Meyers talks about this.  You can
also return a reference and I think it speeds things up.

The second const and & emulate a fast pass by value.  You don't 
have to create the temp to pass but you still cannot alter the
passed in parameter (without heroic efforts on your part).


>Pohl (and others) seem to think that it is good practice to initialize
>objects... and have no undefined values.

Yes I think this is a good idea but you cannot do it generically with
templates.
  float DefaultValue() either is an undefined operation or
      results in an undefined floating point number I forget which.

on the other hand
  Vector DefaultValue() can be well defined.  

You can see this kind of thing when you use templates.  If anybody is 
listening, am I correct on this point?

>is this a bug in the compiler? 

No.

>Thank you very much for any help you can give me!

welcome

Toodles
Andy
From: bhays@teal.csn.org (Boyd Hays)
Newsgroups: comp.lang.c++
Subject: FAQ, String Classes?
Date: 15 Dec 92 03:30:22 GMT
Organization: Colorado SuperNet, Inc.

Hello,
    Is there a FAQ for this group? Specifically I'm interested in people's
    experiences with available libraries of c++ classes eg: NIHCL, Tools.h++.
    Specifically, I'm looking for a "good" string package, either PD or
    commercial.
Thanks in advance,
Boyd Hays
bhays@csn.org
Newsgroups: comp.lang.c++
From: chou@riscee.pko.dec.com (Jesse Chou WSG/SECG)
Subject: help using BCC with template
Followup-To: comp.lang.c++
Organization: Digital Equipment Corporation, Maynard MA
Distribution: ne
Date: Wed, 16 Dec 1992 17:32:51 GMT


This may be a very basic and silly question to ask but I am new to Borland
c++.  It is greatly appreciated that someone could enlighten me or give me
pointer to a FAQ.


I am writing a list class using template and got link error:

Error: Undefined symbol slist_base::append(slink near*) in module tpc.cpp


I had a similar error using other c++ compiler and found that I have to use
a command line switch with the compiler.  I suppose that someone could
easily point to me what I should do in my makefile.  Or maybe there is
other problems that I am not aware of.  In any rate, thanks in advance.



Jesse



-- 
Jesse Chou	-- chou@riscee.enet.dec.com

These words are entered into net by the keyboard.
I am not responsible for them; neither is my employer.
Newsgroups: comp.lang.c++
From: jimad@microsoft.com (Jim Adcock)
Subject: Re:  Give me safe C++
Date: 11 Dec 92 22:23:22 GMT
Organization: Microsoft Corporation

In article <716@ulogic.UUCP> hartman@ulogic.UUCP (Richard M. Hartman) writes:
|the cry comes "oh powers that be, protect us from ourselves", and thus
|we get laws requiring people to wear seatbelts.  It is no that
|I am against seatbelts (or safety), but I was perfectly capable
|of wearing a seatbelt before the law existed. 

To warp your analogy just a little bit, I am reminded of the rental car
I was stuck with recently that "automatically" -- in the name of "safety" 
presented a motorized shoulder harness across my neck every time I tried
to climb in or out of the car.  Meanwhile, while I was automagically getting
strangled, there was no equivalent mechanism to connect the seatbelt, 
so if you did crash, you'd be strung up for good.

No thanks!  Give me the *tools* necessary for safety -- the lapbelts, the
shoulder harnesses, etc, and let *me* apply them myself.  Poorly applied
safety devices are more dangerous than no safety devices at all!
Newsgroups: comp.lang.c++
From: dag@bellman.control.lth.se (Dag Bruck)
Subject: Course in C++ -- Andrew Koenig and Barbara Moo
Summary: One of the best courses on C++ in Europe
Organization: Department of Automatic Control, Lund, Sweden
Distribution: eunet
Date: Fri, 18 Dec 1992 20:40:20 GMT


Andrew Koenig and Barbara Moo, AT&T Bell Laboratories, will give an
introductory course on C++.  This is a rare opportunity to meet two of
the most highly qualified and influential people in the C++ community.
This will be a non-trivial introduction to the C++ language and its
effective application.  We strongly encourage a dialog between
students and lecturers.

Andrew Koenig is a well-known authority on C++ and chairman of the
"core language" working group of the C++ standardization committees.
Author of "C Traps and Pitfalls" and a C++ column in Journal of
Object-Oriented Programming, he's an outstanding lecturer and
programmer.

Barbara Moo is a supervisor at AT&T Bell Laboratories, and was manager
of the team of people that developed AT&T C++ 2.x.  She has a rare
experience of managing a high-performance C++ development group.

The course includes lectures, access to workstations with C++, course
documentation, lunches and course dinner.

   When:	13-16 April 1993
   Where:	Lund Institute of Technology, Sweden (30 km NE Copenhagen)
   Price:	SEK 8000
		SEK 4000 (students and university faculty)
   Language:	English

For more information, please contact:

Dag Bruck
Department of Automatic Control		E-mail: dag@control.lth.se
Lund Institute of Technology
P. O. Box 118				Phone:	+46 46-104287
S-221 00 Lund, SWEDEN			Fax:    +46 46-138118
From: hf@tk.telematik.informatik.uni-karlsruhe.de (Harald Fuchs)
Newsgroups: comp.lang.c++
Subject: Re: Give me safe C++
Date: 18 Dec 92 11:59:42
Organization: Karlsruhe University, Germany
	<1992Dec14.190553.14838@mole-end.matawan.nj.us>
	<1992Dec17.192301.23525@ucc.su.OZ.AU>
NNTP-Posting-Host: whyaduck.telematik.informatik.uni-karlsruhe.de
In-reply-to: maxtal@extro.ucc.su.OZ.AU's message of Thu, 17 Dec 1992 19:23:01 GMT

In article <1992Dec17.192301.23525@ucc.su.OZ.AU>, maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
> Anyone else for nested functions? Against?

I agree that they are sometimes quite handy, but I've never missed
them. In the old days when I was a Modula-2 addict, I used them most
of the time in a situation where I needed a function call in a
specific context (which in turn can be expressed as a kind of
"state"), and this is exactly what objects are for.

> 	(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 :-)

As long as we can tweak the existing language until it gives us some
limited coroutine support, e.g. via setjmp/longjmp, I don't see a
pressing need to extend it.
--

Harald Fuchs <hf@telematik.informatik.uni-karlsruhe.de>
From: ren@function.mps.ohio-state.edu (Liming Ren)
Newsgroups: comp.lang.c++
Subject: How to call C++ functions in a C program?
Date: 17 Dec 1992 11:55:53 -0500
Organization: Department of Mathematics, The Ohio State University
Distribution: world
NNTP-Posting-Host: function.mps.ohio-state.edu

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!
From: aabdalla@pollux.usc.edu (AAA)
Newsgroups: comp.lang.c++
Subject: Minor "Bug" in Borland C++ 3.1?
Date: 18 Dec 1992 07:49:21 -0800
Organization: University of Southern California, Los Angeles, CA
NNTP-Posting-Host: pollux.usc.edu

Has anyone gotten the following irritating bug on Borland C++ 3.1:

Whenever I use GREP from the Transfer Menu, my computer locks up...
("Memory Allocation Error" once, "Exception" other times...)

Whenever I close an edit window, it is not remembered in the sense that
if I press Alt-0, all closed files are missing..

The funny thing is that I used to use BC++ 3.0, and I had no problem.  Only
after I upgraded did I start getting these errors.  Also now whenever I
start working on an old project which I last touched with BC++ 3.0, everything
works (though I do get a warning message that the project file is outdated) 
- up until I exit and come back, then it's back to problems.  I know
that the project file is updated on exit, so my guess is that this is a
problem that may be related to how the project file is being saved.

Any clues?  Please EMAIL me if you have any ideas: aabdalla@pollux.usc.edu

Thanks a lot.
AAA


Newsgroups: comp.lang.c++
From: kanze@us-es.sel.de (James Kanze)
Subject: Re: Is this a compiler bug?
Organization: SEL
	<KANZE.92Dec11165414@slsvdnt.us-es.sel.de>
	<1992Dec11.193023.27787@news2.cis.umn.edu>
Date: 14 Dec 92 21:11:43

In article <1992Dec11.193023.27787@news2.cis.umn.edu>
hansen@deci.cs.umn.edu (David Hansen) writes:

|> In article <KANZE.92Dec11165414@slsvdnt.us-es.sel.de>, kanze@us-es.sel.de (James Kanze) writes:
|> [..]
|> |> 
|> |> If your compiler accepts this code, then it is broken.  (I am
|> |> supposing that NULL is defined as either 0 or 0L; however, in this
|> |> case, nothing changes if it is defined as (void*)0.)  "fptr" and the
|> |> results of "(fptr = bar())" are both pointers to member functions, and
|> |> *not* pointers.  There is no implicit (nor explicit) cast from a
|> |> pointer to member function to an int, a long, or a pointer, so it is
|> |> not legal to compare a pointer to member function to NULL.

|> Ummm, I don't think so.  The ARM on p. 158 describes a possible implementation
|> of pointers to member functions, and it explicitly describes a decision
|> "To allow the representation of a null pointer to member to be 0..."

|> Furthermore, on p. 161, the initialization of a pointer to member function
|> to zero is given, thus:

|>    int (D::*pmf0)() = 0;

|> which kind of implies the conversion of 0 to a pointer to member function
|> does, indeed, exist.

|> |> There is *no* special value for pointers to members, the equivalent to
|> |> NULL for pointers.  So if there are cases where "bar()" cannot return
|> |> a legal value, some other arrangements must be made for it to return a
|> |> status.

This will teach me to post before checking.  My copy of the ARM was at
home, and I was at the office.

Although the parts you quote are from the comments, and as such, not
strictly part of the standard, in section 4.8, it explicitly says that
"A constant expression that evaluates to zero is converted to a
pointer to member.  It is guaranteed that this value will produce a
pointer to member distinguishable from any other pointer to member."
Which is exactly the phrasing used when defining a NULL pointer.

So you do have NULL pointers to members.

|> There is no equivalent to void* for pointers to members -- see p. 70.
|> Is this, perhaps, where the confusion might lie?

Well, part of my confusion may be due to the fact that I constantly
stress that pointers to members are *not* pointers, that I
automatically expect them to have *none* of the characteristics of
pointers.

However, I'm almost sure that I read this somewhere.  I was so sure,
in fact, that when I checked your quote, I immediately supposed that
there was a contradiction in the ARM.  Which lead me to the other
quote, confirming what you say.
--
--
James Kanze                             email: kanze@us-es.sel.de
GABI Software, Sarl., 8 rue du Faisan, F-67000 Strasbourg, France
Conseils en informatique industrielle --
                   -- Beratung in industrieller Datenverarbeitung
Newsgroups: comp.lang.c++
From: haol@staff.tc.umn.edu (HaoLe)
Subject: C++ Code Generator
Organization: University of Minnesota
Distribution: comp.lang.c++
Date: Sun, 20 Dec 1992 04:16:44 GMT

   I am evaluating Object/Designer v20 from ImageSoft Inc. and WinGEN v1.5    
   from Buzzwords International.  I would like your comments and experiences
   with them if you have used them.

   Is there a decent C++ code generator out there that you would like to
   recommend.  I am looking for one that able to generate quality C++ code
   and link to database in the following platform: Windows 3.1 or NT, OS/2 2.0,
   and UNIX.    
 
   Thanks in advance!  
 
Newsgroups: comp.lang.c++
From: pauljo@microsoft.com (Paul Johns)
Subject: Re: IS C++ a language for the "average programmer"
Date: 16 Dec 92 21:18:12 GMT
Organization: Microsoft Corp.

In article <15DEC199210345433@zeus.tamu.edu> sam4628@zeus.tamu.edu wrote:

> Yes, but does OO _really_ allow you to tackle a more complex problem?
> Or does it just allow you a new "notation" which is conveniently adapted
> to the more complex type of problems?  I've never heard of a programming
> goal which absolutely required OO to achieve it -- however, there are
> a large number of math problems which algebra just cannot solve, no
> matter how you manipulate it (assuming, of course, that you don't start
> making simplifying assumptions/approximations).

Given that people have a finite amount of time in which to work and
limited intellectual resources (especially speed and limited "short-
term memory") with which to work, a new convenient notation is very 
important indeed if it allows them to solve more complex problems by
expressing them in quicker, more psychologically-efficient ways.

In the same fashion, one could ask, since all (compiled)
languages are translated into machine language anyway, do ANY
high-level langauges (or, for that matter, assemblers) "_really_ 
allow you to tackle a more complex problem?"

I do, however, agree that if you could simplify the process of
solving problems by ignoring the psychological characteristics
of humans (very limited short-term memory, for one) and the
fact that each person has a finite working time, then you could
effectively argue that it doesn't matter what language you use.

But none of us would return to programming by flipping front
panel switches....
From: heiniw@eebsun1.eeb.ele.tue.nl (Heini Withagen)
Newsgroups: comp.lang.c++
Subject: Looking for a really good C++ debugger
Date: 16 Dec 92 12:58:09 GMT
Organization: Electronic Circuit Design Group, Eindhoven University of Technology, The Netherlands


I am looking for a debugger running under X11. I have GNU gdb-4.7 but it only
accepts command-line input. In one of the accompanying files of gdb it was 
mentioned that some people are working on an X11-interface for gdb.

Does anybody know where I can get the X11-interface for gdb ?? Or does somebody
know another really good debugger for GNU C++. The standard SUN dbx crashes
immediately when started up with an C++ file.

Could somebody help me with this problem, please because I need a good C++
debugger badly.

Thanks 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: cflatter@nrao.edu (Chris Flatters)
Subject: Re: Name-scope semantic differences between 2.
Reply-To: cflatter@nrao.edu
Organization: NRAO
Date: Fri, 11 Dec 1992 21:36:37 GMT

In article 7768@delfin.com, mr@delfin.com (Mark Rosenberg) writes:
>How are CFRONT 2.1 name-scoping semantics different from CFRONT 3.0
>name-scoping semantics? We are developing a product that needs to be
>supported on several different platforms (currently RS-6000 and Sparc).
>This product relies upon Objectstore. According to their support
>people, their compiler has templates but 2.1 name-scope semantics.
>
>Apparently 2.1 name-scope semantics are not a subset of 3.0 name-scope
>semantics. What are the implications of these semantic differences?
>What should one do or not do to maximize compatibility?

Suppose that you declare a nested class as follows.

class foo
    {
    ...
    class bar
	{
	...
	}
    }

According to the ARM the scope of bar is limited to class foo.  cfront
3.0 and g++ 2.x conform to this.

cfront 2.1 gives bar global scope.  To clarify this the definition of
a constructor for bar would look like this according to the ARM

foo::bar::bar() { ... }

but would look like this for cfront 2.1

bar::bar() {...}

To maximise portability between cfront 2.1 and other C++ compilers you can either

1 - avoid using nested classes or

2 - ensure that class names are unique at the innermost scope level (ie.
    make sure that you don't have two or more nested classes with the same
    name) and use the preprocessor to fix up member function definitions.

	Chris Flatters
	cflatter@nrao.edu

Newsgroups: comp.lang.c++
From: mccauleyba@vax1.bham.ac.uk (Brian McCauley)
Subject: Re: char* to const char*&
Date: Fri, 11 Dec 1992 17:58:05 GMT
Organization: University of Birmingham

In article <JPOLITO.92Dec11092330@sysgem1.encore.com>, jpolito@sysgem1.encore.com (Jonathan Polito) writes:
> I am curious to what the current wisdom is on accepting char* as a
> valid argument to a function expecting const char*& e.g.

The net wisdom as distilled from a long discussion a few weeks back is that
one can not allow a `char**' argument to a function wanting a `const char **'.

There as a feeling that perhaps the language should allow a `char *' argument
for a `const char * const *' argument.

The reference situation is no different so the language should not (and to
the best of my knowlwdge does not) allow a `char*' value for a `const char*&'
argument but should (and I think does) allow one for a `const char * const &'
argument.
-- 
    \\   ( )    No Bullshit!     |  Email: B.A.McCauley@bham.ac.uk   
 .  _\\__[oo        from         |  Voice: +44 21 471 3789 (home)
.__/  \\ /\@    /~)  /~[   /\/[  |    Fax: +44 21 625 2175 (work)
.  l___\\      /~~) /~~[  /   [  |  Snail: 197 Harborne Lane,
 # ll  l\\    ~~~~ ~   ~ ~    ~  |         Birmingham, B29 6SS, UK
###LL  LL\\   (Brian McCauley)   |   ICBM: 52.5N 1.9W