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++


On Mon, 18 Dec 2006, Mark Mitchell wrote:

| Ian Lance Taylor wrote:
|
| > Index: gcc/doc/invoke.texi
| > ===================================================================
| > --- gcc/doc/invoke.texi	(revision 119818)
| > +++ gcc/doc/invoke.texi	(working copy)
| > @@ -3215,12 +3215,13 @@ declaration.  This warning is issued eve
| >  provides a prototype.  The aim is to detect global functions that fail
| >  to be declared in header files.
| >
| > -@item -Wmissing-declarations @r{(C only)}
| > +@item -Wmissing-declarations @r{(C and C++ only)}
| >  @opindex Wmissing-declarations
| >  Warn if a global function is defined without a previous declaration.
| >  Do so even if the definition itself provides a prototype.
| >  Use this option to detect global functions that are not declared in
| > -header files.
| > +header files.  In C++, no warnings are issued for functions which are
| > +explicitly declared inline, or for templatized functions.
|
| "templatized functions" is not a standard term; please say "function
| templates" (or "specializations of function templates").  Also, you've
| exempted members of anonymous namespaces, so that should be documented too.

The warning should NOT be conditionalized on the fact that the function is
*explicitly* declared inline.  It suffices that it is inline.  There
is no need for the artificial distinction.

-- Gaby


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