This is the mail archive of the gcc-bugs@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]

[Bug c/21159] [4.0/4.1 Regression] "no effect" warning despite cast to void*


------- 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


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