I am using C51 compiler V7.50 I don't know if this 'works' on other versions however I was able to crash the compiler by this 'silly' macro usage
// causes compiler to crash #define WORD_SIZE(N) (sizeof((N))/sizeof(uint16_t)) // doesn't cause compiler to crash #define WORD_SIZE(N) (sizeof(N)/sizeof(uint16_t)) #define NSIZE WORD_SIZE(uint16_t) // crash point size = NSIZE;
I determined the point at which the compiler expired by #ifdef #endif usage to narrow down the section of 'death'. Erstwhile I corrected my macro (duh moment), however it is a bit difficult to find the offending code if the compiler just dies (oh well). This is a 'Just In Case' post I suppose.
Stephen
View all questions in Keil forum