For example, define a variable
Code: Select all
uintmax_t some_variant_variable;
And then use them for many data types with type casting as if it could hold any data type (actually it seems it can):
Code: Select all
//Pairs of variable update and printing it
//in its raw form:
///
(double)some_variant_variable=(double)0;
printf("%d",(uint16_t)some_variant_variable);
(double)some_variant_variable++;
printf("%d",(uint16_t)some_variant_variable);
(double)some_variant_variable++;
printf("%d",(uint16_t)some_variant_variable);
I think that it could be done more than we could think in production code (declaring a variable that is big enough and using it as a variable that could hold any data type, via massively explicit type casting), and probably that's why there are so many complex warnings when compiling the different open source projects.