For purposes of type checking I would like to define a function on the lines of
void myfunc(type1 a, type2 b)
{
...
}
where type1 and type2 are both typedefed to uint8_t. So far so good, but for sanity and checking purposes (think DbC) I would like to prevent the function being called with a type2 value for the first parameter or a type1 for the second. Sadly, C’s implicit typecasting is against me here. Does anyone know of a way?
You could wrap the two types in a Struct.
Edit:
I don’t like it because you now have to use a.data instead of a