This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: PATCH RFA: Support -Wmissing-declarations in C++


Gabriel Dos Reis <gdr@cs.tamu.edu> writes:

> |  It makes sense in the C++ world too, though I agree that
> | it is not as important in C.  This option applies only to global
> | functions, not to classes, nor to functions declared within classes
> | (aka methods).
> 
> and not to (implicit) specializations of templates, etc.
> 
> Which makes it nearly pointless.

Some people write C++ as a "better C".  For those people, this option
is useful.

> Idiomatic C++ is based on the notion that you don't need to declare a
> function before defining it -- and there are lot of functions you can't
> declare that way.  What this option will do is replicate another
> -Weffc++ fiasco.

I disagree.  Nobody is going to accidentally turn on this option
thinking that it is useful, unless they understand what it does.  And,
even if they do, it is unlikely to ever fire for them if they write
your "idiomatic C++."

Ian


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