[fpc-pascal] when will the size of an enumerated type change?

Dennis dec12 at avidsoft.com.hk
Wed Jan 9 16:34:12 CET 2019


Type
    TComparisonMode = (cmThisOnly, cmThisAndThat, cmThisOrThat);


TMyClass = class
public
var
    ComparisonMode : TComparisonMode;
end;


I discovered that, the sizeof(ComparisonMode) seem to be different 
depending on whether the type TComparisonMode is defined in the same 
unit file or in another unit file.

Is that possible?

I cannot create a simple test file to test it because the problem only  
appears in my big project.

Does FPC always produce a 4 byte variable for an enumerated types?

Dennis



More information about the fpc-pascal mailing list