This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56289] Bad location for unused value warning with comma operator
- From: "manu at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 Apr 2013 16:49:44 +0000
- Subject: [Bug c++/56289] Bad location for unused value warning with comma operator
- Auto-submitted: auto-generated
- References: <bug-56289-4 at http dot gcc dot gnu dot org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56289
Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2013-04-19
CC| |manu at gcc dot gnu.org
Summary|Bad unused value warning |Bad location for unused
|with comma operator |value warning with comma
| |operator
Ever Confirmed|0 |1
--- Comment #4 from Manuel LÃpez-IbÃÃez <manu at gcc dot gnu.org> 2013-04-19 16:49:44 UTC ---
The location could be better but it is pretty close for C++:
test.c:4:14: warning: right operand of comma operator has no effect
[-Wunused-value]
(void) x, y; /* warning: right operand of comma operator has no effect
^
But the C FE is pretty awful:
test.c:4:3: warning: statement with no effect [-Wunused-value]
(void) x, y; /* warning: right operand of comma operator has no effect
^
Clang:
test.c:4:13: warning: expression result unused [-Wunused-value]
(void) x, y; /* warning: right operand of comma operator has no effect
^