foreach: fixed maybe uninitialized warning in test (-O2) /home/rusty/devel/cvs/ccan/ccan/tap/tap.h:57:59: warning: ‘max_iters’ may be used uninitialized in this function [-Wmaybe-uninitialized] _gen_result(1, __func__, __FILE__, __LINE__, "%s", #e) : \ ^ /home/rusty/devel/cvs/ccan/ccan/foreach/test/run-nested.c:47:17: note: ‘max_iters’ was declared here int i, j, sum, max_iters; Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
foreach: fix overzealous test. Andreas Schlick reported a failure on 64-bit systems; we should simply test that the number of iterators does not grow on second iteration, rather than assuming an explicit limit as compilers may vary. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
foreach: make test more accurate, fix for 64-bit gcc 4.4.3 gcc (Ubuntu 4.4.3-4ubuntu5) 4.4.3 on x86_64 uses a different stack offset for the second call to test_ptr_recursion(), meaning it sees new iterators. Put it inside a loop to reduce the chance of that happening.
various: make the _info License: wording uniform for GPL variants. GPL versions 2 and 3 both specifically mention "any later version" as the phrase which allows the user to choose to upgrade the license. Make sure we use that phrase, and make the format consistent across modules.
foreach: fix case where iterators are not on the stack. The foreach garbage collection assumed that iterators were all on the stack, but they could be on the heap or a global (or static) variable. We can prevent the heap case by tricky use of macros to complain on any iterator which isn't a single token, but we can't prevent globals/statics. So, if an iterator already seems to be "off" the stack, mark it as such and simply never free it.