23 typedef int (*fptr
)(int);
29 typedef int int_type1
;
31 #define gen_sw(a) _Generic(a, const char *: 1, default: 8, int: 123);
36 signed long int l
= 2;
38 const int * const ptr
;
42 i
= _Generic(a
, int: a_f
, const int: b_f
)();
44 i
= _Generic(a
, int: a_f() / 2, const int: b_f() / 2);
46 i
= _Generic(ptr
, int *:1, int * const:2, default:20);
50 i
= _Generic(titi
, struct a
:1, struct b
:2, default:20);
52 i
= _Generic(i2
, char: 1, int : 0);
54 i
= _Generic(a
, char:1, int[4]:2, default:5);
56 i
= _Generic(17, int :1, int **:2);
58 i
= _Generic(17L, int :1, long :2, long long : 3);
60 i
= _Generic("17, io", char *: 3, const char *: 1);
62 i
= _Generic(ti
, const unsigned char *:1, const char *:4, char *:3,
63 const signed char *:2);
65 printf("%s\n", _Generic(i
+ 2L, long: "long", int: "int",
66 long long: "long long"));
67 i
= _Generic(l
, long: 1, int: 2);
69 i
= _Generic(foo
, fptr
: 3, int: 4);