Lazarus (LCL) throws exception if compiled with -CR (win 32 only)
Original Reporter info from Mantis: Martin @martin_frb
-
Reporter name: Martin Friebe
Original Reporter info from Mantis: Martin @martin_frb
- Reporter name: Martin Friebe
Description:
-CR apprently ensures correct typecasting.
But in lcl\interfaces\win32\win32wsforms.pp line 395
if wcfInitializing in TWinControlAccess(AWinControl).FWinControlFlags then
which is:
type
TWinControlAccess = class(TWinControl)
end;
This is simply to bypass encapsulation. Variables in TWinControlAccess are memory-located the same as in TWinControl, and because TWinControlAccess is declared in the current package, the code is suddenly allowed to access protected values...
-CR verifies that AWinControl inherits from TWinControlAccess, which it doesn't.
In this particular case, there is no bug (as in wrong behaviour) behind this. it's more a design issue. But it makes it impossible to test the rest of the LCL.
Mantis conversion info:
- Mantis ID: 11697
- Version: 0.9.25 (SVN)
- Monitored by: » @JuhaManninen (Juha Manninen), » errno (errno)