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: unassig...@gcc.gnu.org ReportedBy: thomased...@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.