Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Suspect linker fault

Altera_Forum
名誉分销商 II
1,032 次查看

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 项奖励
0 回复数
回复