This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/53871] Please warn about endless loops if they are obvious
- From: "tim.ruehsen at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 09 Jul 2012 11:50:19 +0000
- Subject: [Bug c/53871] Please warn about endless loops if they are obvious
- Auto-submitted: auto-generated
- References: <bug-53871-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53871
--- Comment #2 from Tim Ruehsen <tim.ruehsen at gmx dot de> 2012-07-09 11:50:19 UTC ---
(In reply to comment #1)
> (In reply to comment #0)
> > Obvious endless loops could be reported, e.g. if the loop condition doesn't
> > change and the loop can't be left otherwise.
>
> There has been discussions about this since more than ten years ago and nothing
> has happened:
>
> http://gcc.gnu.org/ml/gcc/1999-08n/msg00720.html
More than 12 years of discussions... sigh.
> My understanding is that the probability of an existing GCC dev implementing
> this is very close to zero for various reasons: People are busy with other
> things, not trivial to implement for non-trivial code, risk of being too noisy,
> and there are other tools better at this job like splint and Clang's static
> analyzer.
Neither splint nor clang understands gcc/ibm/intel nested functions, which I
use a lot (yes, I know of the stack execution issue). Clang community so far
refused to implement it, they propably never will. At least they have 'blocks'
which might be a good alternative to nested functions.
Splint isn't developed since 2007. Many years ago, I put nested functions on
splint's wishlist - same answer as yours: "go and implement it yourself !". (If
I had time to to that, I wouldn't have put it on the wishlist but created a
patch.)
Maybe it's time for a gcc static analyzer...