Book a Demo

Author Topic: Problem with code synchronization and #else block  (Read 2670 times)

AndiA

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Problem with code synchronization and #else block
« on: November 29, 2007, 05:00:01 am »
Hello,

we are using C code in Enterprise Architect (7.0.818 Professional) with code reverse engineering.
I have a problem when there is an #else statement in the code
EA ignores every element in this #else block
e.g.:
Code: [Select]

#if !defined _MODULE_
int var1 = 123;
#else
int var2 = 123;
#endif

On code reverse engineering var2 is ignored here.

My current workaround is to replace the #else by another #if statement:
Code: [Select]

#if !defined _MODULE_
int var1 = 123;
#endif
#if defined _MODULE_
int var2 = 123;
#endif


Is it possible to ignore the #else statement via the Preprocessor Macros somehow
or is there any other solution?

Thanks,
Andi

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Problem with code synchronization and #else bl
« Reply #1 on: November 29, 2007, 11:23:43 am »
I'm afraid that EA explicitly ignores everything inside else blocks because if it doesn't there are situations where the file becomes impossible to parse.