diff options
author | Joseph Myers <jsm@polyomino.org.uk> | 2004-07-17 10:20:51 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2004-07-17 10:20:51 +0100 |
commit | 3e3970a27611d6cf2c5d8cfaa73e9e17f38b530c (patch) | |
tree | e4dd6ebe816e96ed4438c19008d235f68f8c19fc /gcc/doc | |
parent | 10c383a4be1ee140d5387bb0448ffb160e97896d (diff) | |
download | gcc-3e3970a27611d6cf2c5d8cfaa73e9e17f38b530c.zip gcc-3e3970a27611d6cf2c5d8cfaa73e9e17f38b530c.tar.gz gcc-3e3970a27611d6cf2c5d8cfaa73e9e17f38b530c.tar.bz2 |
c-typeck.c (parser_build_binary_op): Condition warnings for X<=Y<=Z on -Wparentheses instead of -Wextra.
* c-typeck.c (parser_build_binary_op): Condition warnings for
X<=Y<=Z on -Wparentheses instead of -Wextra.
* doc/invoke.texi: Update. Document that most of -Wparentheses is
supported for C only.
testsuite:
* gcc.dg/Wparentheses-2.c, gcc.dg/Wparentheses-3.c,
gcc.dg/Wparentheses-4.c, Wparentheses-5.c, Wparentheses-6.c,
Wparentheses-7.c, Wparentheses-8.c, Wparentheses-9.c: New tests.
From-SVN: r84860
Diffstat (limited to 'gcc/doc')
-rw-r--r-- | gcc/doc/invoke.texi | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 7bf2d40..14f756b 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -2250,7 +2250,13 @@ Warn if a user-supplied include directory does not exist. Warn if parentheses are omitted in certain contexts, such as when there is an assignment in a context where a truth value is expected, or when operators are nested whose precedence people -often get confused about. +often get confused about. Only the warning for an assignment used as +a truth value is supported when compiling C++; the other warnings are +only supported when compiling C@. + +Also warn if a comparison like @samp{x<=y<=z} appears; this is +equivalent to @samp{(x<=y ? 1 : 0) <= z}, which is a different +interpretation from that of ordinary mathematical notation. Also warn about constructions where there may be confusion to which @code{if} statement an @code{else} branch belongs. Here is an example of @@ -2569,11 +2575,6 @@ but @samp{x[(void)i,j]} will not. An unsigned value is compared against zero with @samp{<} or @samp{>=}. @item -A comparison like @samp{x<=y<=z} appears; this is equivalent to -@samp{(x<=y ? 1 : 0) <= z}, which is a different interpretation from -that of ordinary mathematical notation. - -@item Storage-class specifiers like @code{static} are not the first things in a declaration. According to the C Standard, this usage is obsolescent. |