summaryrefslogtreecommitdiff
path: root/ccan/foreach/test/compile_ok-nonconst.c
blob: e533a9d321ab5c30255011b0985b56f2e655e190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <ccan/foreach/foreach.h>
#include <ccan/foreach/foreach.c>

/* Iterating const over non-const pointers should work fine. */
int main(int argc, char *argv[])
{
	char *p;
	unsigned int i = 0;

	foreach_ptr(p, argv[0], argv[1])
		i++;

	return i == 2 ? 0 : 1;
}