Delphi 2006 compiler bug, again

Having just finished a new version of CCR Exif (or so I thought), I opened up Turbo Delphi to test it under the D2006 compiler, and the damn thing raised an internal error when attempting to build a new demo I had written. At first I thought the issue was the use of a class helper, yet the error still arose when I removed the helper. Turned out D2006 doesn’t like directly calling a method on a record property:

  if not ExifData.ShutterSpeedValue.MissingOrInvalid then
    AddValue('Shutter speed', '%.4g milliseconds', [ExifData.ShutterSpeedInMSecs]);

The fix is easy mind — use a variable as an intermediary:

  Temp: TExifSignedFraction;
  Temp := ExifData.ShutterSpeedValue;
  if not Temp.MissingOrInvalid then
    AddValue('Shutter speed', '%.4g milliseconds', [ExifData.ShutterSpeedInMSecs]);

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s