This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Code optimization: warning for code that hangs
- From: Robert Dewar <dewar at adacore dot com>
- To: Ángel González <keisial at gmail dot com>
- Cc: Richard Guenther <richard dot guenther at gmail dot com>, gcc-help at gcc dot gnu dot org, "Peter A. Felvegi" <petschy at praire-chicken dot com>, gcc at gcc dot gnu dot org
- Date: Sun, 24 Jun 2012 17:54:47 -0400
- Subject: Re: Code optimization: warning for code that hangs
- References: <4FE5B390.1000203@praire-chicken.com> <mcrsjdmnizh.fsf@dhcp-172-18-216-180.mtv.corp.google.com> <CAFiYyc0rG=WpPf9Huee-oAsEfrjT0fH8iUG+GDzKbB4a-wGVFw@mail.gmail.com> <4FE73B9E.5000008@gmail.com>
On 6/24/2012 12:09 PM, Ángel González wrote:
"Peter A. Felvegi" writes:
My question is: wouldn't it be possible to print a warning when a jmp
to itself or trivial infinite recursion is generated? The code
compiled fine w/ -Wall -Wextra -Werror w/ 4.6 and 4.7.
Note that if the target architecture is a microcontroller, an endless
loop can be a legitimate way to finish / abort the program.
But not an infinite recursion! And an endless loop is such a rare
case that it deserves a warning, it's a false positive in this case,
so what?