Yapılandırma, sadece derleme değil, optimizasyon açıksa Delphi 6'yı kullanırken dahili derleyici hatasıyla aşağıdaki hata oluşur. Inc() işlevi yerine ödevi kullanır. Bu bir derleyici hatası mı? Garip kayıt yapıları, orijinal kodun bu minimal örneğe indirgenmesidir.Bu kod bir derleyici hatası nedeniyle oluşturulamıyor mu?
program Project1;
type
requestCountsType = array[0..1] of
record
processed: int64;
end;
talliestype = record
counts: requestCountsType;
end;
healthtype = record
charged: talliestype;
end;
procedure computeProcessed(const h: healthtype; var requests, bytesin, bytesout: int64);
var i: byte;
begin
requests := 0; bytesin := 0; bytesout := 0;
for i := 0 to 1 do
begin
inc(requests, h.charged.counts[i].processed); // including this generates compiler internal error C1405 when optimization is on
// requests := requests + h.charged.counts[i].processed; // this works
end;
end;
var ht: healthtype; var r, b1, b2: int64;
begin
computeProcessed(ht, r, b1, b2);
end.
Bir iç derleyici hatasının bir hata olduğunu söyleyebilirim, evet. Kod geçerli değilse, en azından doğru bir hata beklersiniz. İnc 'kodunuzda yanlış bir şey olmadığına inanıyorum. Ve eğer optimizasyon olmadan çalışırsa .. – Blorgbeard
Sağlık tipinin * const * 'undan hoşlanmıyor gibi görünüyor. –
Zamanın% 99.99'u, derleyici bir hata olduğunu düşünüyorsanız, öyle değil. Gerçek olanı yakalamak için +1. –