projects
/
ccan
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
foreach: more const iteration fixes.
[ccan]
/
ccan
/
foreach
/
test
/
compile_ok-nonconst.c
1
#include <ccan/foreach/foreach.h>
2
#include <ccan/foreach/foreach.c>
3
4
/* Iterating const over non-const pointers should work fine. */
5
int main(int argc, char *argv[])
6
{
7
char *p;
8
unsigned int i = 0;
9
10
foreach_ptr(p, argv[0], argv[1])
11
i++;
12
13
return i == 2 ? 0 : 1;
14
}