Compiler doesn't refresh #defines when changing between Targets

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Compiler doesn't refresh #defines when changing between Targets

681 次查看
RValls
Contributor III

Hi all!

I am having troubles when changing the target of a project and having defined several names to identify each one:

 

I have two targets, and each one has two diferent paths (one with "{Project}\Target 1" and the other with "{Project}\Target 2"). Inside of each of this folders, exists two files with the same name ("options.h"), so each target has its own options. I have defined in one file "AT24C1024" and in the other "AT24C512".

 

Finally, in a common file I have the following:

#if defined(AT24C1024)
   #define MEMORY_PAGE_SIZE AT24C1024_PAGESIZE
   #define MEMORY_NUM_PAGES AT24C1024_NUMPAGES
   #define MEMORY_DIR_LEN AT24C1024_DIR_LEN
#elif defined(AT24C512)
   #define MEMORY_PAGE_SIZE AT24C512_PAGESIZE
   #define MEMORY_NUM_PAGES AT24C512_NUMPAGES
   #define MEMORY_DIR_LEN AT24C512_DIR_LEN

#endif

so I can use from now MEMORY_PAGE_SIZE independently of the options.h file I am using.

 

Everything works fine, until I change the target. When changing the target, the correct option (either AT24C1024 or AT24C512) is highlighted, but if I do "Go to Macro declaration" for the MEMORY_PAGE_SIZE, it points to the wrong one. This is happening even if I compile the target without cleaning it before, generating invalid binary files (I have got the option "Generate Browser Data From" set to "Compiler").

 

There is any workaround, patch or something?

I am using CodeWarrior Classic IDE, v. 7.2.2, but it also happened to me with v. 7.1, both of them targeting Coldfire V2 (MCF52233 derivative)

 

NOTE: Using the pre-processor panel to define the target options instead of different files in different paths has the same behaviour.

 

Thanks in advance,

Ruben

标签 (1)
0 项奖励
回复
1 回复

573 次查看
J2MEJediMaster
Specialist I

That sounds like odd behavior there. I suggest filing a service request on this. Click here to do that. You may need to send a zip archive of a project that exhibits the problem to tech support.

 

---Tom

0 项奖励
回复