This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/21159] [4.0/4.1 Regression] "no effect" warning despite cast to void*
- From: "jsm28 at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Apr 2005 21:56:02 -0000
- Subject: [Bug c/21159] [4.0/4.1 Regression] "no effect" warning despite cast to void*
- References: <20050422105955.21159.bruno@clisp.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jsm28 at gcc dot gnu dot org 2005-04-26 21:55 -------
What's actually happening is that GCC 4 is building trees for comma expressions
in accordance with how the C standard says they are parsed, where previous
versions were not.
(void)a, (void)b, c
is parsed as ((void)a, (void)b), c rather than as (void)a, ((void)b, c). The
choice of internal representation should make no difference to the code
generated but as here it can affect diagnostics. The diagnostic does seem
useless here where the left-hand side of the expression is a comma expression
with the right-hand side cast to void, so I'll add that as a case for which the
diagnostic is disabled.
--
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jsm28 at gcc dot gnu dot org
|dot org |
Status|NEW |ASSIGNED
Last reconfirmed|2005-04-22 11:23:13 |2005-04-26 21:55:59
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21159