taylor@lanai.cs.ucla.edu (Charles Taylor) (09/12/89)
Hello, I'm using g++ 1.36.0- on a Sun 4/60.
g++ is giving me a very odd error message when I try to compile a
constructor:
// EXCERPT
dstream::dstream(int level = 0, ostream& outs = cerr)
{
debug_level = level;
out = &outs;
} // this is line 20.
//end excerpt
//compiler output.
g++ -c -pipe -DNO_PARAM_IN -Wstrict-prototypes -Wimplicit
-Wreturn-type -Wpointer-arith -Wcomment -Ilibg++ dstream.cc
dstream.cc: In method dstream::dstream (int (= 0 ), class ostream &
(= cerr )):
dstream.cc:20: in base initialization for class `dstream'
dstream.cc:20: warning: control reaches end of non-void function
make: *** [dstream.o] Error 1
tweety.cognet.ucla.edu%
Ok, I guess the error message is
"in base initialization for class `dstream'".
What does that mean?
And also, with the warnings on, g++ (like gcc) complains if you return
without a value from a non-void returning function. But it didn't let
me declare constructors (such as this one) to return a void type, so I
can't get the warning to go away. But I can live with this---it's
that other error that's baffling me.
Please excuse my ignorance, I'm a novice at c++...
Matt Kennel
kennel@cognet.ucla.edu