From 3e3970a27611d6cf2c5d8cfaa73e9e17f38b530c Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Sat, 17 Jul 2004 10:20:51 +0100 Subject: 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 --- gcc/doc/invoke.texi | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'gcc/doc') 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. -- cgit v1.1