This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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
            ^

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]