View Issue Details

IDProjectCategoryView StatusLast Update
0037358FPCRTLpublic2020-07-15 14:07
ReporterFr0sT Assigned ToMarco van de Voort  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platformx64OSWindows 
Product Version3.3.1 
Summary0037358: feInvalidHandle declared as typed const disallowing assignments to other constants
DescriptionIn file rtl\objpas\sysutils\fileutilh.inc the feInvalidHandle constant is declared as

  feInvalidHandle : THandle = THandle(-1);

so that if we want to assign it to some other constant (f.ex. for making a cross-compiler interface) we'll fail

  const InvalidHandle = feInvalidHandle; // fails

Is it really necessary to use such declaration istead of

  feInvalidHandle = THandle(-1);

?
TagsNo tags attached.
Fixed in Revision45790
FPCOldBugId
FPCTarget-
Attached Files

Activities

Marco van de Voort

2020-07-15 12:32

manager   ~0124037

Changed as advised because reasons for original construct are unclear and probably historic, added by oro in 2006 as feinvalidhandle : Thandle =-1 and then modified by Jonas for unsigned thandle types in 2007 to feinvalidhandle : Thandle =thandle(-1).

The RTL never seems to try to assign the values, so why waste memory and cause the problem the Bug-reporter has? -> CHANGE

Issue History

Date Modified Username Field Change
2020-07-15 10:06 Fr0sT New Issue
2020-07-15 12:32 Marco van de Voort Assigned To => Marco van de Voort
2020-07-15 12:32 Marco van de Voort Status new => resolved
2020-07-15 12:32 Marco van de Voort Resolution open => fixed
2020-07-15 12:32 Marco van de Voort Fixed in Revision => 45790
2020-07-15 12:32 Marco van de Voort FPCTarget => -
2020-07-15 12:32 Marco van de Voort Note Added: 0124037