On Sun, December 3, 2017 22:10, Nikolay Nikolov wrote:
> On 12/02/2017 10:50 PM, Lubomír Čabla wrote:


Hi,

>> FPC 3.0.2
>>
>> function get_segment_base_address(d : word) : longint;
>> function set_segment_base_address(d : word;s : longint) : boolean;
>>
>> FPC 3.0.4
>>
>> function get_segment_base_address(d : word) : longint;
>> function set_segment_base_address(d : word;s : dword) : boolean;
>>
>> For get_segment_base_address is correct longint or dword?
> I think (and I'm the one, who made the change) dword is more correct,
> because segment bases can be >=2GB and longint is signed, so results in
> a negative number. In theory, it should only matter if you have range
> checking turned on, but I think 32-bit linear addresses should only be
> declared as dword (or longword) and previous code, that used longint, or
> added longint typecasts to avoid range check errors should be fixed.

That makes sense (and DJGPP sources assume the same), but
get_segment_base_address should probably return a dword as well then,
right?


> Maybe I should document it in:
> http://wiki.freepascal.org/User_Changes_3.0.4 ? I kinda skimped on that,
> because it only affects existing code, when range checking is on, and
> usually range checking is turned off for low level selector manipulating
> code.

Yes, adding a note there would be better.

Tomas


_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to