Doc: mention platform-dependent behavior of bitshift operators

There have been several recent complaints that << and >> don't behave
the same way on all supported platforms.  There is a risk that <<
overflows the signed integer type, which is undefined behavior, and there
are platform-dependent behaviors from shifting by numbers of bits >= the
bitwidth of the type, and also from shifting by negative values.

Document this to warn unsuspecting users of these facts.

Author: David Rowley <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: 
https://postgr.es/m/CAApHDvr0O6ZF8NO=Rq9Q+Sz=FHT=nz1kkntxzdcnph-owuk...@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/a13659ca66764f183e6704d2ccac2b3886ad383d

Modified Files
--------------
doc/src/sgml/func.sgml | 7 +++++++
1 file changed, 7 insertions(+)

Reply via email to