Complete.Org: Mailing Lists: Archives: freeciv-dev: December 2004:
[Freeciv-Dev] Re: (PR#6933) Don't skip the iterate_end macros
Home

[Freeciv-Dev] Re: (PR#6933) Don't skip the iterate_end macros

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: i-freeciv-lists@xxxxxxxxxxxxx
Subject: [Freeciv-Dev] Re: (PR#6933) Don't skip the iterate_end macros
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Sun, 19 Dec 2004 18:50:04 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=6933 >

On Sat, 18 Dec 2004, email_address=jdorje@xxxxxxxxxxx wrote:

> <URL: http://bugs.freeciv.org/Ticket/Display.html?id=6933 >
>
> > <URL: http://bugs.freeciv.org/Ticket/Display.html?id=6933 >
> >
> > Raimar Falke wrote:
> >>
> >> If the body of the iterate however contains a goto or return statement
> >> the _iterate_end macro isn't executed and the counter is wrong. The
> >> idea here is to forbid such behavior.
> >>
> >> The attached script tries to find such places. Run it like
> >>  $ find . -name "*.c" | xargs -n 1 python balanced_iterate.py
> >
> >   This script looks like a good candidate for 'make src-check'.
> >
> >   Sadly, it finds more problems than it did a year ago:
> > bash-2.05b$ find freeciv -name "*.c" | xargs -n 1 python
> > patches/balanced_iterate.py | wc -l
> >      125
>
> I kindof thought we'd given up on that idea.  Per's recent genlist patches
> have used garbage collection instead.

I dislike garbage collection. But then again, I dislike bug-prone APIs
that require one to run scripts to detect faults even more.

Hmmm...

---
Vasco Alexandre da Silva Costa @ Instituto Superior Tecnico, Lisboa





[Prev in Thread] Current Thread [Next in Thread]