Unsafe type in Spring.pas
Issue #348
invalid
The compiler warns about the "unsafe type" in the Spring.pas file, I don't know if this is a sensible report or a false report.
[dcc32 Warning] Spring.pas(8999): E1046 Unsafe type 'TFieldTable'
procedure MoveManaged(source, target, typeInfo: Pointer; count: Integer);
type
TFieldInfo = packed record
TypeInfo: PPTypeInfo;
Offset: NativeInt;
end;
PFieldTable = ^TFieldTable;
TFieldTable = packed record
Size: Integer;
Count: Integer;
case TTypeKind of <====================== in this line
tkArray: ( ElemType: PPTypeInfo );
tkRecord: ( Fields: array[0..0] of TFieldInfo );
end;
function GetFieldTable(typeInfo: Pointer): PFieldTable; inline;
begin
Result := PFieldTable(PByte(typeInfo) + PByte(typeInfo)[1] + 2);
end;
Comments (3)
-
repo owner -
reporter Delphi 10.3.2, x86
Output warning → Unsafe type → True
I first set Unsafe Type → Error, but then I had a compilation error just, after change to True I get warning only. I don't know if it's important, but I report.
-
repo owner - changed status to invalid
Probably bogus - that warning is not enabled in my package anyway.
- Log in to comment
Compiler Version? Platform? Any compiler option that differ from those in the package for that compiler version?