summaryrefslogtreecommitdiff
path: root/lib/ccan/tcon/test/compile_fail.c
blob: 683bbd62ffdefb85434b04c3fa716dbd78d30a16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <ccan/tcon/tcon.h>
#include <stdlib.h>

struct container {
	void *p;
};

struct int_container {
	struct container raw;
	TCON(int *canary);
};

int main(int argc, char *argv[])
{
	struct int_container icon;
#ifdef FAIL
	char *
#else
	int *
#endif
		x = NULL;

	tcon_check(&icon, canary, x)->raw.p = x;
	return 0;
}