build: Use ntlm_auth from source3 as the only ntlm_auth installed on the system
[Samba.git] / lib / ccan / cast / test / compile_fail-cast_const.c
blob277f3de1c442b21fd9a8953b560a97d5bbb80e58
1 #include <ccan/cast/cast.h>
2 #include <stdlib.h>
4 /* Note: this *isn't* sizeof(char) on all platforms. */
5 struct char_struct {
6 char c;
7 };
9 int main(int argc, char *argv[])
11 char *uc;
12 const
13 #ifdef FAIL
14 struct char_struct
15 #else
16 char
17 #endif
18 *p = NULL;
20 uc = cast_const(char *, p);
21 (void) uc; /* Suppress unused-but-set-variable warning. */
22 return 0;
25 #ifdef FAIL
26 #if !HAVE_TYPEOF||!HAVE_BUILTIN_CHOOSE_EXPR||!HAVE_BUILTIN_TYPES_COMPATIBLE_P
27 #error "Unfortunately we don't fail if cast_const can only use size"
28 #endif
29 #endif