This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: What does this warning mean?
- To: Peter Simons <peter dot simons at gmd dot de>
- Subject: Re: What does this warning mean?
- From: Thomas Kunert <kunert at physik dot tu-dresden dot de>
- Date: Sun, 23 Aug 1998 11:31:57 +0200
- CC: egcs at cygnus dot com
- Organization: TU Dresden
- References: <x7g1eoq00k.fsf@peti.gmd.de>
Peter Simons wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
>
> My egcs warns me and I don't have the slightest idea what he's
> complaining about. I am compiling a C++ class which models regular
> expressions in C++. When compiling with "-Wall -ansi -pedantic -O2", I
> get the following warnings:
>
> | RegExp.hpp:74: warning: default argument given for parameter 3 of `
> | bool RegExec(const class string &, const class RegExp &,
> | struct regmatch_t * = 0, size_t = 0, int = 0)'
> | RegExp.hpp:70: warning: after previous specification in `
> | bool RegExec(const class string &, const class RegExp &,
> | struct regmatch_t * = 0, size_t = 0, int = 0)'
You should give default arguments only in the first declaration of a
function, neither in subsequent declarations nor in the definition.
--
Thomas Kunert