What does this warning mean?
Jason Merrill
jason@cygnus.com
Tue Aug 25 07:28:00 GMT 1998
>>>>> Joe Buck <jbuck@synopsys.com> writes:
>> > 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++.
> Correct, but in the past g++ ignored this problem (in fact, it's unclear
> to me exactly what happened if the values of the default arguments
> differ: do you get the last one the compiler saw, or the first one).
Not exactly; it ignored a redefinition to the same value. That code hasn't
changed, and a quick test verifies that behavior. I'd need a testcase to
determine why this isn't working in this case.
Jason
More information about the Gcc
mailing list