[Bug c++/56289] New: Bad unused value warning with comma operator

2013-02-11 Thread thomaseding at gmail dot com


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.


[Bug c++/56289] Bad unused value warning with comma operator

2013-02-11 Thread thomaseding at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56289



--- Comment #2 from Thomas  2013-02-11 18:35:29 
UTC ---

But x was used inside the comma operator.