[fpc-devel] Fix for SwapEndian

Michael Schnell mschnell at lumino.de
Tue Apr 29 17:00:19 CEST 2008

>> I think shr is supposed to work sign-extending with signed types.
> The above statement may cause some confusion, so people who think that 
> "shr" means "shift arithmetic right", please read the comment added to 
> http://bugs.freepascal.org/view.php?id=10545
OOPs !?!?!?!

They say: "SHR is /always/ unsigned in TP/FPC/Delphi."

This would mean that the patch the OP mentioned should not be necessary 
(but obviously it is and so there seems to be some bug somewhere).

The stuff about first converting and then shifting seems quite queer 
(unless the types left and right are different which imposes queer 
behavior in C, too).


More information about the fpc-devel mailing list