Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Debugger    [ Add a report in this area ]  
Report #:  40319   Status: Closed
Problems with closing the {$ENDIF} directive
Project:  Delphi Build #:  2600
Version:    10.0 Submitted By:   Daniel Codres
Report Type:  Basic functionality failure Date Reported:  2/12/2007 6:27:31 AM
Severity:    Infrequently encountered problem Last Updated: 8/19/2012 8:57:04 PM
Platform:    All platforms Internal Tracking #:  
Resolution: Test Case Error (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (2 Total Ratings)
5.00 out of 5
Total Votes: None
Description
It seems that there are some problems when closing the brackets on the {$ENDIF} compiler directive. This bug I found in version 5.0, 7.0 and Turbo Explorer.
Steps to Reproduce:
{DEFINE AddCode}


{$IFDEF AddCode}
  ...
  Custom Code
  ...
{$ENDIF
} <-- by mistake one CR was added. The code will compile with no warnings or errors


...
Normal Code
...

The tracepoints in the "Normal Code" will be shifted up with one line... The code will be very hard to debug since the source seem to be unsynchronized.
Workarounds
None
Attachment
None
Comments

Florent Ouchet at 2/12/2007 7:17:49 AM -
Just tested with the following code:

program Project5;

{$APPTYPE CONSOLE}

uses
  SysUtils;

{$DEFINE TEST}

begin
  WriteLn('test1');
  {$IFDEF TEST}
  WriteLn('test2');
  {$ENDIF TEST
  }
  WriteLn('test3');
  { TODO -oUser -cConsole Main : Insert code here }
end.

I got a blue dot in the editor gutter for every WriteLn statements.

The issue may be caused by an unexpected CR character in the source file; however mixing CR + LF and CR eol in a single source file is not supported.

Server Response from: ETNACODE01