I have declared in source file src1.c following variables.
xdata unsigned char keybuffer[8]; unsigned int keys; unsigned char keyctr;
I have an another source file src2.c and I want to declare variables into same memory places.
How can I declare in src2.c variables into same memory area with variables in src1? I know that my software do not use variables declared in src1.c in this case.
Is there something like following way to use?
extern unsigned char keyctr; unsigned char var2 _at_ keyctr; //compiler does not accept this.
regards Arto
I know that my software do not use variables declared in src1.c in this case.
Then those variable don't deserve having external linkage in src1.c. Odds are they shouldn't even have file scope inside src1.c.
You're basically trying to outsmart the linker's overlay analysis. Are you sure you're up to it?
Yes, you are absolutely right. I thought that also and it is better to belive linker analysis feature. Using of union is of course one possibility(mentioned in previous answer). Thanks everybody for answers.