[cfe-dev] "expression result unused" in comma expression

Ted Kremenek kremenek at apple.com
Tue Aug 28 10:21:23 PDT 2007


A test case to the frontend generated the following unexpected warning:

   warning: expression result unused
     x = ++x, ++y, y+2;
     ^~~~~~~~~~~~~~~~~

   int comma_in_assignment(int x, int y) {
     x = ++x, ++y, y+2;
     return x;
   }

Removing the "++x" also generates the same warning.  Any thoughts?  Is  
this desired behavior?



More information about the cfe-dev mailing list