summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/usr.bin/xlint/lint1/d_type_question_colon.c
blob: 00f69cde6bcc871c761521a271327286ac4e2cab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* the type of the ?: expression should be the more specific type */

struct foo {
	int bar;
};

void
test(void) {
	int i;
	struct foo *ptr = 0;

	for (i = (ptr ? ptr : (void *)0)->bar; i < 10; i++)
		test();
}
OpenPOWER on IntegriCloud