I'm planing use Structs containing an scalar field in my C Code, to do some semantic strong typing. The basic idea is macros for cheap "operations", that will fail on wrongly named struct fields, and of course more complex functions by strict parameter list.
Examples (Only the basic Idea - not exspecially clever macro code)
typedef struct {float32_t speedval} MySpeed_t;
typedef struct {float32_t timeval} MyTime_t;
typefed struct {float32_t accvalue} MyAcceleration_t;
#define ACC_VEL_DT(acc,vel,time)\
(((acc).accvalue = (vel).speedval / (time).timeval)), (acc))
#define ADD_SPEED(velres, vel1, vel2) \
(((velres).speedval = (vel1).speedval + (vel2).speedval), (velres))
unint8 someCleverMathAndCheck(MySpeed_t speed, MySpeed_t speedArr[], MyAcceleration_t);
Now what do I have to expect from a compiler when handling such onelement structures? Must I expect some padding, more complex asm for "dereferencing the first element", or horrible things when using those constructs as function parameters? What does the standard say about?