We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
This declaration const char code* const gBuildDate = __DATE__; gives lots of link errors when I use RTX51 Tiny but is fine without RTX. (My program uses conditional compilation to build either a RTX or non-RTX version) Any ideas?
This always works for me:
// In each module static const char s_moduleInfo[] = __FILE__ " modified " __DATE__ " at " __TIME__; // Or in one module that is set to "always build". const char g_projInfo[] = "Project modified " __DATE__ " at " __TIME__;
What link errors?
const char code* const gBuildDate = __DATE__;
const char *pVar; // pVar can be modfied but not what it points to. char * const pVar; // pVar cannot be modified but what it points to can. const char * const pVar; // Neither pVar nor what it points to can be modified.
Ok Ive realised whats wrong - I was running out of DATA space. If I change the declaration to this const char code* code gBuildDate = __DATE__; its OK. I expected since the pointer was 'const' it would automatically go into code space but apparently not, you have to use 'code'.