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
* [Bug c/46158] Spurious never executed warning
2010-10-24 19:54 [Bug c/46158] New: Spurious never executed warning wkf at alum dot mit.edu
@ 2010-10-24 19:59 ` wkf at alum dot mit.edu
2010-10-25 21:02 ` [Bug middle-end/46158] " pinskia at gcc dot gnu.org
2010-10-25 21:02 ` [Bug c/46158] " pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: wkf at alum dot mit.edu @ 2010-10-24 19:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46158
--- Comment #1 from William K Foster <wkf at alum dot mit.edu> 2010-10-24 19:59:23 UTC ---
Also, in a much more complicated test case (not provided) I get a much more
obtuse warning message that does not refer me to my file, but instead a header:
/usr/include/c++/4.2/bits/allocator.h: In copy constructor
'std::allocator<_Alloc>::allocator(const std::allocator<_Alloc>&) [with _Tp =
char]':
/usr/include/c++/4.2/bits/allocator.h:103: warning: will never be executed
/usr/include/c++/4.2/bits/allocator.h:102: warning: will never be executed
/usr/include/c++/4.2/ext/new_allocator.h: In copy constructor
'__gnu_cxx::new_allocator<_Tp>::new_allocator(const
__gnu_cxx::new_allocator<_Tp>&) [with _Tp = char]':
/usr/include/c++/4.2/ext/new_allocator.h:70: warning: will never be executed
/usr/include/c++/4.2/bits/allocator.h: In destructor
'std::allocator<_Alloc>::~allocator() [with _Tp = char]':
/usr/include/c++/4.2/bits/allocator.h:108: warning: will never be executed
/usr/include/c++/4.2/ext/new_allocator.h: In destructor
'__gnu_cxx::new_allocator<_Tp>::~new_allocator() [with _Tp = char]':
/usr/include/c++/4.2/ext/new_allocator.h:75: warning: will never be executed
/usr/include/c++/4.2/bits/allocator.h: In destructor
'std::allocator<_Alloc>::~allocator() [with _Tp = char]':
/usr/include/c++/4.2/bits/allocator.h:108: warning: will never be executed
gmake: *** [ARCH.freebsd_61_i86/debug/opFlume_delta.o] Error 1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c/46158] Spurious never executed warning
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 ` [Bug middle-end/46158] " pinskia at gcc dot gnu.org
@ 2010-10-25 21:02 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-25 21:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46158
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WONTFIX
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> 2010-10-25 21:01:51 UTC ---
-Wunreachable-code is broken and has been removed from GCC 4.5. Do not use it.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/46158] Spurious never executed warning
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 c/46158] " pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2010-10-25 21:02 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46158
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|c |middle-end
Target Milestone|--- |4.5.0
^ 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 ` [Bug middle-end/46158] " pinskia at gcc dot gnu.org
2010-10-25 21:02 ` [Bug c/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).