Oh nooo! (gotos)

T. William Wells bill at twwells.com
Tue Sep 12 11:45:34 AEST 1989


In article <7887 at goofy.megatest.UUCP> djones at megatest.UUCP (Dave Jones) writes:
: From article <1989Sep8.070123.4416 at twwells.com), by bill at twwells.com (T. William Wells):
: ) : while(rule = (Rule*)Queue_iter_next(&rule_iter)) {
: ) :   while(rsym = (Symbol*)Queue_iter_next(&rsym_iter)) {
: ) :    switch (derives(rsym)) {
: ) :    case derives_nothing:
: ) :      goto next_rule;
: ) :    ....
: ) :    }
: ) :   }
: ) : next_rule: continue;
: ) : }
: )
: )     while(rule = (Rule*)Queue_iter_next(&rule_iter)) {
: )             while(rsym = (Symbol*)Queue_iter_next(&rsym_iter)) {
: )                     switch (derives(rsym)) {
: )                     case derives_nothing:
: )                             break;
: )                     .... (cases that want to loop use continue)
: )                     }
: )                     break;
: )             }
: )     }
: )
:
:                              you removed a goto but added a
: fatal bug.  I would prefer the goto.

Well yeah, so would I. But what is the bug? I've just reread the code
and don't see where I've broken it. I'm prepared to be red-faced
because this has go to be something really obvious, but what?

---
Bill                    { uunet | novavax | ankh | sunvice } !twwells!bill
bill at twwells.com



More information about the Comp.lang.c mailing list