On 14/10/16 11:44, Marco van de Voort wrote:

If the dword version returned $FFFFFFFF it could be at least typecasted to

You can typecast the result to shortint to get -1 in that case.

So the questions are:
1. why do the primitives deliver a signed result ?


2. why do they not all deliver -1 for their with ($FFFF for 2-byte etc).

Probably because that is how the originally submitted generic implementation behaved: http://bugs.freepascal.org/view.php?id=17592

3. (for Michael: :-) why doesn't the documentation doesn't mention the
behaviour for no bits set?).

Since (3) the behaviour is not documented, we can still fix this ? :-)

They've behaved like this since FPC 2.6.0, so no.

fpc-devel maillist  -  fpc-devel@lists.freepascal.org

Reply via email to