11

When building a project there are two places where source line count is reported:

  1. On the compile progress dialog
  2. Under Project | Information

In Delphi 2007 these two numbers were identical for the project we are building.

In Delphi 2010 these two numbers are wildly different. The (1st) count is larger by a count of 1 million lines or 40%. The (2nd) count is close enough to the Delphi 2007 count to be satisfied the correct files are being built accounting for code changes in porting to D2010. Alternative versions of source files simply do not exist in the build environment.

So the question is:

Why are 1st and 2nd line count so drastically different in D2010 when they were understandably identical in D2007?

Related:

Why does line count change so much from D2007 to D2010?

Community
  • 1
  • 1
  • 2
    I did a preliminary test with a single unit console application, and only saw a single line discrepancy between both values, however with a forms based project the values were much more widely different. It does not appear to be caused to {$IFDEF} blocks, comments or blank lines. – skamradt Feb 03 '10 at 18:00
  • 2
    Exact same question as: http://stackoverflow.com/questions/2188479/why-does-line-count-change-so-much-from-d2007-to-d2010 – Nick Hodges Feb 03 '10 at 18:46
  • Steve, next time post any additions as a comment to the previous post instead of intentionally creating a duplicate. It avoids clutter. – Ken White Feb 03 '10 at 19:38
  • 3
    Mason posted the question on my behalf in the first place. I don't have enough rep to comment on Mason's question and all the answers were missing the point. Delphi 2010 reports two completely different numbers for source lines compiled on the same project in the same compile. You can call this a dupe question, but the answers in the other thread ARE NOT addressing THIS question. –  Feb 03 '10 at 20:18
  • @Nick Based on your comment in the other question I can't see how you can consider this an exact duplicate because differences in compile paths have absolutely nothing to do with my question. It's two numbers reported for the SAME compile. –  Feb 03 '10 at 22:50
  • +1, so now you should have enough rep to comment :) – Jørn Schou-Rode Feb 03 '10 at 22:51

2 Answers2

11

We've investigated this, and it is a bug. It came as a result of shifting to MS Build. We've fixed it in our current build.

The correct number is the one in the Project Information menu. The one that is reported in the compiling dialog is, well, an "approximation".

Nick Hodges
  • 16,902
  • 11
  • 68
  • 130
0

Not parsed (ifdefed) code getting counted in D2007 because the empty line algorithm was too simple ? A small test would show.

Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
  • In D2010, we tested IFDEFed blocks, blank lines, and comment lines and we could associate these with the discrepancy in the two different line counts within the same D2010 build. At least not with a very simple test project. –  Feb 03 '10 at 21:31
  • Correction: we could NOT associate these blocks with the discrepancy. –  Feb 03 '10 at 22:51