public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56289] New: Bad unused value warning with comma operator
@ 2013-02-11 18:00 thomaseding at gmail dot com
  2013-02-11 18:33 ` [Bug c++/56289] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: thomaseding at gmail dot com @ 2013-02-11 18:00 UTC (permalink / raw)
  To: gcc-bugs


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.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-09-07  7:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-11 18:00 [Bug c++/56289] New: Bad unused value warning with comma operator thomaseding at gmail dot com
2013-02-11 18:33 ` [Bug c++/56289] " pinskia at gcc dot gnu.org
2013-02-11 18:35 ` thomaseding at gmail dot com
2013-02-11 18:40 ` pinskia at gcc dot gnu.org
2023-09-07  5:18 ` [Bug c++/56289] Bad location for " gayathri.gottumukkala.27 at gmail dot com
2023-09-07  7:16 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).