
+1
Completed
False positive W521 when returning a record
We have many functions that look like this:
function TQuerEbenheit_EA_Daten.Abscissa: TAbscissa;
begin
Result.AssignKm(Messkm);
end;
TAbscissa is an extended record with mutliple AssingXxx methods that initialize its value. So the result is actually initialized. I haven't got a good idea how to solve this. Maybe instead of an AsssignXxx method I should change this to a constructor call with an assignment?
Result := TAbscissa.CreateFromKm(Messkm);
But that would add the overhead of creating an additional record and assigning it to result. Not much of an overhead. The problem is more that we would have to rewrite lots of code.
function TQuerEbenheit_EA_Daten.Abscissa: TAbscissa;
begin
Result.AssignKm(Messkm);
end;
TAbscissa is an extended record with mutliple AssingXxx methods that initialize its value. So the result is actually initialized. I haven't got a good idea how to solve this. Maybe instead of an AsssignXxx method I should change this to a constructor call with an assignment?
Result := TAbscissa.CreateFromKm(Messkm);
But that would add the overhead of creating an additional record and assigning it to result. Not much of an overhead. The problem is more that we would have to rewrite lots of code.

0
Under review
Roman 10 years ago
I will fix this in the next release.

0
Planned
Roman 10 years ago

0
Started
Roman 10 years ago

0
Completed
Roman 10 years ago
Customer support service by UserEcho