public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/46158] New: Spurious never executed warning
@ 2010-10-24 19:54 wkf at alum dot mit.edu
  2010-10-24 19:59 ` [Bug c/46158] " wkf at alum dot mit.edu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wkf at alum dot mit.edu @ 2010-10-24 19:54 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Spurious never executed warning
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: wkf@alum.mit.edu


// test.cpp

#define testIt(expression)                        \
{                                    \
  if (expression) {                            \
      throw true;                            \
  }                                    \
}

void
useIt()
{
  bool eof = false;

  testIt(eof)
}

// End of test.cpp

--------------------------------------------

gcc --version; gcc -Werror -Wunreachable-code -o test.o test.cpp

--------------------------------------------

gcc (GCC) 4.2.1 20070719  [FreeBSD]
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

cc1plus: warnings being treated as errors
test.cpp: In function 'void useIt()':
test.cpp:15: warning: will never be executed


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

end of thread, other threads:[~2010-10-25 21:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-24 19:54 [Bug c/46158] New: Spurious never executed warning wkf at alum dot mit.edu
2010-10-24 19:59 ` [Bug c/46158] " wkf at alum dot mit.edu
2010-10-25 21:02 ` pinskia at gcc dot gnu.org
2010-10-25 21:02 ` [Bug middle-end/46158] " pinskia 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).