]> git.ozlabs.org Git - ccan/blob - compile_ok-nonconst.c
e533a9d321ab5c30255011b0985b56f2e655e190
[ccan] / 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 }