This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/56289] New: Bad unused value warning with comma operator
- From: "thomaseding at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Feb 2013 17:59:59 +0000
- Subject: [Bug c++/56289] New: Bad unused value warning with comma operator
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56289
Bug #: 56289
Summary: Bad unused value warning with comma operator
Classification: Unclassified
Product: gcc
Version: 4.6.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: thomaseding@gmail.com
Compile the following with -Wunused-value:
int main () {
int x = 0;
int y = 0;
(void) x, y; /* warning: right operand of comma operator has no effect
[-Wunused-value] */
return 0;
}
This is a bad warning, as casting to void should eliminate the warning for both
x and y.