This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Semicolons at the end of member function definitions
- From: "Manuel López-Ibáñez" <lopezibanez at gmail dot com>
- To: "Dirk Mueller" <dmueller at suse dot de>
- Cc: "Volker Reichelt" <v dot reichelt at netcologne dot de>, "Gabriel Dos Reis" <gdr at cs dot tamu dot edu>, gcc at gcc dot gnu dot org
- Date: Thu, 2 Aug 2007 11:18:11 +0100
- Subject: Re: Semicolons at the end of member function definitions
- References: <tkrat.6fde7d1faf6cb977@netcologne.de> <200708020006.27575.dmueller@suse.de>
On 01/08/07, Dirk Mueller <dmueller@suse.de> 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.