1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
/* * Rule: EXP44-C * Source: wiki * Status: PASS - Should NOT trigger EXP44-C violation */ #include <stdio.h> #define S(val) _Generic(val, int : 2, \ short : 3, \ default : 1) void func(void) { int a = 0; int b = S(a); ++a; printf("%d, %d\n", a, b); }