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.
Hello all, I'm having problem declaring bit as global in header file to avoid including extern bit xxx in other files. I've followed Keil instruction from this link: http://www.keil.com/support/docs/1868.htm
So far all the variables are good, and I don't have to use extern type variable xxx any more. For bit I try to do this:
_DECL bit xxx _INIT(x);
but it doesn't work. Is there any way to get it through? Would it be good to use struct in this case? If so, how should I do this? Any inputs would be greatly appreciated.
Best Regards, T.L
But you are still at risk from typos like
#ifdef "the module that has the definitions" signed blah #else extern unsigned blah #endif
And, because the preprocessor trick ensures that the compiler can never see both, then you are assured that it can never warn you!