This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: What does this warning mean?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]