If I have two units, each containing the same variable name, but of different types, being of "file scope", the linker does not appear to raise a duplicate definitions error. What happens is that, in this particular instance, memory space for the smaller type is being allocated, and presumably they appear at the same address. This causes the consecutive variables to be overwritten.
Oops! I now put a module name prefix on all module-global variables......链接已复制
0 回复数
