What does this warning mean?

Martin von Loewis martin@mira.isdn.cs.tu-berlin.de
Sun Aug 23 01:33:00 GMT 1998


>  | 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)'
>
> Can anyone explain me what egcs is complaining about?

I'd think the error message is pretty clear. You have a prototype
declaration of RegExec in line 70 of RegExp.hpp that defines default
arguments.

You have another prototype declaration (or a definition) in line 74,
and this provides default arguments as well. It is an error to give
default arguments twice in standard C++.

Hope this helps,
Martin

(and yes, the source code of the respective lines in question would
have helped)



More information about the Gcc mailing list