This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
GCC-3.1: g++ and default parameters of methods
- From: Rene Rebe <rene dot rebe at gmx dot net>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 16 Jun 2002 02:56:19 +0200 (CEST)
- Subject: GCC-3.1: g++ and default parameters of methods
Hi.
During converting GSMP to compile with the recent g++ 3.1 we had to
convert many occurencies of this style:
xyz.hh:
void some_func (int p1, int p2 = 666);
xyz:cc:
void some_func (int p1, int p2 = 666);
to xyz.cc:
void some_func (int p1, int p2);
^^^^^^^^
Because g++ emmited (e.g.) the following error message:
DataLayer.cc:224: default argument given for parameter 4 of `
GSML::DataLayer::DataLayer(const std::string&, GSML::DataFileIndex*,
GSML::PCMDatatype*, unsigned int = 44100)'
../include/DataLayer.hh:113: after previous specification in `
GSML::DataLayer::DataLayer(const std::string&, GSML::DataFileIndex*,
GSML::PCMDatatype*, unsigned int = 44100)'
make[2]: *** [DataLayer.o] Error 1
Is this a really enforced by the ANSI C++ Standard and so a feature,
or a regression?
Sincerely
René Rebe
--
René Rebe (Registered Linux user: #248718 <http://counter.li.org>)
e-mail: rene.rebe@gmx.net, rene@rocklinux.org
web: www.rocklinux.org, drocklinux.dyndns.org/rene/
Anyone sending unwanted advertising e-mail to this address will be
charged $25 for network traffic and computing time. By extracting my
address from this message or its header, you agree to these terms.