pgsql: Doc: mention platform-dependent behavior of bitshift operators - Mailing list pgsql-committers

From David Rowley
Subject pgsql: Doc: mention platform-dependent behavior of bitshift operators
Date
Msg-id E1xC6Mh-00000001wPi-0QyW@gemulon.postgresql.org
Whole thread
List pgsql-committers
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 <dgrowleyml@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/CAApHDvr0O6ZF8NO=Rq9Q+Sz=FHT=NZ1kkNTXZDcNph-OWuk7TQ@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2250163c3964eec31eef74182f5bd772d4adb543

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


pgsql-committers by date:

Previous
From: David Rowley
Date:
Subject: pgsql: Doc: mention platform-dependent behavior of bitshift operators
Next
From: David Rowley
Date:
Subject: pgsql: Doc: mention platform-dependent behavior of bitshift operators