summaryrefslogtreecommitdiffstats
path: root/lib/ccan/str/test/compile_fail-isspace.c
blob: bfee1f89f166614b603b9aec5c2315ad430a3af0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#define CCAN_STR_DEBUG 1
#include <ccan/str/str.h>

int main(int argc, char *argv[])
{
#ifdef FAIL
#if !HAVE_BUILTIN_TYPES_COMPATIBLE_P || !HAVE_TYPEOF
#error We need typeof to check isspace.
#endif
	char
#else
	unsigned char
#endif
		c = argv[0][0];

#ifdef FAIL
	/* Fake fail on unsigned char platforms. */
	BUILD_ASSERT((char)255 < 0);
#endif

	return isspace(c);
}