diff options
author | Manuel Lopez-Ibanez <manu@gcc.gnu.org> | 2007-05-20 00:45:58 +0000 |
---|---|---|
committer | Manuel Lopez-Ibanez <manu@gcc.gnu.org> | 2007-05-20 00:45:58 +0000 |
commit | d51347137ca9f7b6b9ca9eca2cfe851b3620141c (patch) | |
tree | bbcc1e2ae00d84751fb6d9e0d94ad59c5dd5ae75 /gcc/doc | |
parent | d68471e512aa804ae96cc788dea743f04857b133 (diff) |
2006-05-20 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR middle-end/7651
* doc/invoke.texi (Wreturn-type): Complete description.
(Wextra): Delete item about return-type warning.
* c-decl.c: Delete redundant Wextra warning.
testsuite/
* gcc.dg/20030906-1.c: Replace Wextra with Wreturn-type.
* gcc.dg/20030906-2.c: Likewise.
* objc.dg/method-17.m: Add -Wreturn-type.
* obj-c++.dg/method-21.mm: Likewise.
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@124866 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7aef897f0f5..7be81671b13 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2807,9 +2807,13 @@ This warning is enabled by @option{-Wall} for C and C++. @item -Wreturn-type @opindex Wreturn-type -Warn whenever a function is defined with a return-type that defaults to -@code{int}. Also warn about any @code{return} statement with no -return-value in a function whose return-type is not @code{void}. +@opindex Wno-return-type +Warn whenever a function is defined with a return-type that defaults +to @code{int}. Also warn about any @code{return} statement with no +return-value in a function whose return-type is not @code{void} +(falling off the end of the function body is considered returning +without a value), and about a @code{return} statement with a +expression in a function whose return-type is @code{void}. 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, @@ -3130,22 +3134,6 @@ messages for these events: @itemize @bullet @item -A function can return either with or without a value. (Falling -off the end of the function body is considered returning without -a value.) For example, this function would evoke such a -warning: - -@smallexample -@group -foo (a) -@{ - if (a > 0) - return a; -@} -@end group -@end smallexample - -@item An unsigned value is compared against zero with @samp{<} or @samp{>=}. @item @r{(C only)} |