[fpc-pascal] shift right operation with variables

Michael Schnell mschnell at lumino.de
Tue Aug 18 09:35:01 CEST 2015


AFAIK literals are integer unless denoted otherwise

The type of the operands determines the operation. this is rather 
obvious for e.g. "+" but not obvious for shift operations.

AFAIK, the type left of the ":=" does not determine the operation. This 
is not obvious for everybody.

I never rely on the hidden rules behind this mechanism (which even might 
be different in Pascal and C. but prefer using intermediate variables 
for sake of clearness.

You can be sure that GCC optimizes those away. I hope fpc does the same.

-Michael



More information about the fpc-pascal mailing list