I use the following means of making .h files usable in assembler #ifdef CCODE // bypass structs for assembler modules structs ... such as typedef struct { ......... } E1_SEI; #endif extern U8 ... extern U16 ... etc this works very well. Now, on occasion I am interested in assembler having access to sizeof E1_SEI Currntly I have C code saving the size in a variable that the assembler reads, but that is ineffective and a "discrete" #define sizeofE1_SEI nnn is dangerous. anyone found a way to do this? Erik
#if structsize == (sizeof (STRUCC)) That would be a less elegant, but workable solution It would be --- but it's not, because doesn't actually work. The C preprocessor doesn't know about sizeof(). In more conventional terms, you're trying to perform a compile-time assert() in C, which doesn't exist.
#if structsize == (sizeof (STRUCC))
It would be --- but it's not, because doesn't actually work. The C preprocessor doesn't know about sizeof() I stated: "I have tried this one in order to get an error if wrong but get errors on it" thanks, I, evidently tried to do the impossible, so now I can leave it alone. However, since Keil does proudly state "you can use .h files in C" would it not be a desirable addition to this "nonstandard" functionality? Erik