i'm not down to 3 syntax errors from 600+. here is one of them:
while (1) {
0(7054) WARNING: <core> [cfg.y:2898]: warning in config file, line 1838, column 12: constant value in while(...)
how do i write a while statement where condition is always true?
-- juha
On Jun 01, 2009 at 18:01, Juha Heinanen jh@tutpro.com wrote:
i'm not down to 3 syntax errors from 600+. here is one of them:
while (1) {
0(7054) WARNING: <core> [cfg.y:2898]: warning in config file, line 1838, column 12: constant value in while(...)
how do i write a while statement where condition is always true?
while(1), but you'll always get a warning on start-up. If you want to get rid of the warning you could try while(! defined $foobar), but it would have a minor performance impact.
Andrei
Andrei Pelinescu-Onciul writes:
while(1), but you'll always get a warning on start-up.
If you want to get rid of the warning you could try while(! defined $foobar), but it would have a minor performance impact.
i don't want the performance hit. please remove the warning. i don't get that kind of warning in other programming languages either.
-- juha
On Jun 01, 2009 at 18:36, Juha Heinanen jh@tutpro.com wrote:
Andrei Pelinescu-Onciul writes:
while(1), but you'll always get a warning on start-up.
If you want to get rid of the warning you could try while(! defined $foobar), but it would have a minor performance impact.
i don't want the performance hit. please remove the warning. i don't get that kind of warning in other programming languages either.
You don't becaue that are languages were an infinite while() makes sense. In a sip-router script the while() by itself is strange, and an infinite while is an abomination :-)
Andrei
Andrei Pelinescu-Onciul writes:
You don't becaue that are languages were an infinite while() makes sense. In a sip-router script the while() by itself is strange, and an infinite while is an abomination :-)
if someone writes
while(1)
i'm pretty sure, he/she knows what he/she is doing.
i would replace 1 with a variable, but result would slower and three statements longer.
-- juha