There were a couple of questions regarding coding style in the previous thread. 1) The problem is that I am a strong advocate for the OOP principle of data encapsulation and inheritance. Though C does does support them directly in semantics, you can still use these principles by modifying your style. In my current design I have a IoPins module, a HardwareInterfaceA module, and a HardwareInterfaceB module. The problem is that the code in BOLD is illegal. Hence my quest for the work arounds. (I could have defined a base class of IoPinsAddress, but I like the idea of encapsulating the type with the address.) Ideally I would like:
// 'class' IoPins volatile IoPins_xOUTC pdata _at_ 0x68; volatile const IoPins_xPINSC pdata _at_ 0x78;
// 'class' HardwareInterfaceA : IoPins #include "IoPins.h" volatile pdata struct { BYTE :2; BYTE ResetLCD :1; } IntfA_Pins _at_ IoPins_xOUTC;
// 'class' IntfB : IoPins #include "IoPins.h" volatile const pdata struct { BYTE :1; BYTE ResetLCD :1; } IntfB_xPins _at_ IoPins_xPINSC;