[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #45143] infinite FOR loop limits fail
From: |
Rik |
Subject: |
[Octave-bug-tracker] [bug #45143] infinite FOR loop limits fail |
Date: |
Fri, 24 Jul 2020 12:56:16 -0400 (EDT) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko |
Follow-up Comment #11, bug #45143 (project octave):
I added a new warning ID, "Octave:infinite-loop", in case programmers
intentionally want to use this construct (it is valid, and it would be
annoying to use it and every warning for every m-file invocation). See
changeset https://hg.savannah.gnu.org/hgweb/octave/rev/a9f1a922367b.
In the documentation, I made the description general to any infinite loop, not
just
for i = 1:Inf
I haven't looked at it, but it is my hope that the interpreter could detect a
static while loop or until loop condition as well and also call
warning_with_id(). For example,
while (1)
Even better would be detecting a static expression such as
while (true == true)
but most people intending to create an infinite loop will probably use the the
simple constructs outlined above.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?45143>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/