This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Don't issue warning about unused last statements in expression statements
- From: Gabriel Dos Reis <gdr at codesourcery dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: rth at redhat dot com, aoliva at redhat dot com, gcc-patches at gcc dot gnu dot org
- Date: 04 Jan 2002 16:32:48 +0100
- Subject: Re: [PATCH] Don't issue warning about unused last statements in expression statements
- Organization: CodeSourcery, LLC
- References: <20020104143246.A531@sunsite.ms.mff.cuni.cz>
Jakub Jelinek <jakub@redhat.com> writes:
| Hi!
|
| Alex's 2002-01-02 patch introduced lots of statement with no effect
| warnings in expansion of glibc macros.
| The thing is that gcc used to suppress this warning inside of ({ }),
| but after the patch it is issued if the value is not used.
| E.g. glibc memset expansion uses ({ }) and thus gcc gives warning
| if nobody uses the return value of memset.
| The following patch suppresses the warning in this case again, with the
| difference that it warns about statements with no effect if they are not
| at the end of statement expression.
| Ok to commit (or would you prefer to get back the pre-2002-01-02 behaviour,
| which would simplify the patch (just s/! want_value/expr_stmts_for_value == 0/
| in the tests around the warning in expand_expr_stmt_value))?
Apparently, that patch affects not only Glibc but also usual C++
programs (see a recent report from Gerald). I would like to see the
pre-2002-01-02 behaviour back.
-- Gaby