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] PR c++/30601: Update documentation


Dirk Mueller <dmueller@suse.de> writes:

| Hi, 
| 
| PR 30601 points out a documentation defect, my previous patch which improved 
| the -Wreturn-type warning for C++ did not properly update the documentation. 
| 
| I'm not 100% if this is pre-approved, therefore I'm posting it for review. 
| bootstrapped on i686-suse-linux. 
| 
| 2007-01-29  Dirk Mueller  <dmueller@suse.de>
| 
|         PR c++/30601
|         * doc/invoke.texi (-Wreturn-type): Update description to
|         match new behavior.
| 
| --- invoke.texi	(revision 121080)
| +++ invoke.texi	(working copy)
| @@ -2643,11 +2643,13 @@ Warn whenever a function is defined with
|  @code{int}.  Also warn about any @code{return} statement with no
|  return-value in a function whose return-type is not @code{void}.
|  
| -For C, also warn if the return type of a function has a type qualifier
| -such as @code{const}.  Such a type qualifier has no effect, since the
| -value returned by a function is not an lvalue.  ISO C prohibits
| -qualified @code{void} return types on function definitions, so such
| -return types always receive a warning even without this option.
| +Also warn if the return type of a function has a type qualifier
| +such as @code{const}.  For ISO C such a type qualifier has no effect,
| +since the value returned by a function is not an lvalue.
| +For C++, the warning is only emitted for scalar types or @code{void}.
| +ISO C prohibits qualified @code{void} return types on function
| +definitions, so such return types always receive a warning
| +even without this option.

This seems OK for me.

-- Gaby


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