Re: [REPORT] Static analys warnings

2020-05-04 Thread Ranier Vilela
Fix possible overflow when converting, possible negative number to uint16. postingoff can be -1,when converts to uint16, overflow can raise. Otherwise, truncation can be occurs, losing precision, from int (31 bits) to uint16 (15 bits) There is a little confusion in the parameters of some functions

Re: [REPORT] Static analys warnings

2020-05-03 Thread Andres Freund
On 2020-05-03 17:05:54 -0300, Ranier Vilela wrote: > 1. Warning: the right operand to | always evaluates to 0 > > src/include/storage/bufpage.h > #define PAI_OVERWRITE (1 << 0) > #define PAI_IS_HEAP (1 << 1) > > #define PageAddItem(page, item, size, offsetNumber, overwrite, is_heap) \ > PageAddI