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] Don't issue warning about unused last statements in expression statements


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


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