This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/22414] assert(i) gives "will never be executed" due to noreturn
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2005 19:50:59 -0000
- Subject: [Bug c/22414] assert(i) gives "will never be executed" due to noreturn
- References: <20050711193826.22414.h.b.furuseth@usit.uio.no>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2005-07-11 19:50 -------
The warning is correct as there is an assigment for a temporary.
The assert should be written like:
void abort(void);
void f(int i)
{
i ?(void) 0 : abort();
}
Please report this bug to glibc.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22414