On 01/08/07, Dirk Mueller <[EMAIL PROTECTED]> wrote: > On Tuesday, 31. July 2007, Volker Reichelt wrote: > > So, assuming that this hasn't changed in a newer standard then I guess you're > right and the check should only be a warning with -pedantic, (and > no -pedantic-errors) given. This is however not implementable currently. As I > don't know why -pedantic-errors is on by default for C++ (but not for C), the > only possibility I see is indeed to revert this patch and add a > comment/testcase. > pedantic-errors is not on by default in C++. The function pedwarn() produces errors by default in C++ as opposed to C. On the other hand, -pedantic-errors makes pedwarn() produce errors instead of warnings AND sets the flag "pedantic". It is a subtle difference. (Then, "-pedantic" sets the flag "pedantic" but does not change the way pedwarn() works" and "-fpermissive" just change "pedwarn()" to emit warnings instead of errors). This is how it works internally, now whether it is reflecting the desired behaviour I just don't know.
With the above cheat sheet, you can play to guess what is the actual effect of combinations like 1) "-pedantic", 2) "-pedantic -fpermissive" 3) "-fpermissive -Werror" 4) "-fpermissive" 5) "-pedantic-errors -fpermissive". (As you will see, 4 and 5 are not the same, so no, -pedantic-errors is not enabled by default in C++ however, 2 and 5 will produce the same output in C++). I hope this clarifies. Cheers, Manuel.