In C, you can wrap a value in a universal choice that only supports one type:
#include <stdbool.h> #include <stdio.h> bool x = true; int y = _Generic(1, bool:2); int main(void) { printf("%d\n", y); }
These errors (GCC 4.9), but will compile without complaint if you replace 1 with true or x .
So for your example:
#include <stdbool.h> void function( int value, bool flag ) { }
source share