[BUG] $Define / $Undefine in "dead" $IfDef blocks

Post your requests and ideas on the future development of mikroPascal.
Post Reply
Author
Message
Ric
Posts: 44
Joined: 01 Mar 2007 10:35
Location: Italy

[BUG] $Define / $Undefine in "dead" $IfDef blocks

#1 Post by Ric » 05 Mar 2007 10:59

Code: Select all

{$Undefine Foo}
{$Undefine Bar}

{$IfDef Foo} // Since Foo is not defined...
  {$Define Bar} // ...this definition should be ignored
{$EndIf}

{$IfDef Bar}
 const
  cMyConst = 1; // cMyConst takes this value...
{$Else}
 const
  cMyConst = 2; // ...instead of this one.
{$EndIf}
:shock:

$Define and $Undefine should be ignored inside "dead" $IfDef / $Else / $Endif blocks, i.e. inside blocks of code that do not get compiled.

This is, IMHO, in the fix-it-by-yesterday category, as everyone who has ever used a preprocessor will expect a consistent behaviour.

User avatar
zristic
mikroElektronika team
Posts: 6608
Joined: 03 Aug 2004 12:59
Contact:

Re: [BUG] $Define / $Undefine in "dead" $IfDef blo

#2 Post by zristic » 05 Mar 2007 12:50

You are right, we will fix this.

Thanks.

Ric
Posts: 44
Joined: 01 Mar 2007 10:35
Location: Italy

#3 Post by Ric » 05 Mar 2007 15:32

You're welcome. ;) Thank you for your consideration.

Post Reply

Return to “mikroPascal Wish List”