On Sat, Jul 29, 2023 at 7:37 PM Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> wrote:
>
> Hi,
>
> The pg_leftmost_one_pos32 function with msvc compiler,
> relies on Assert to guarantee the correct result.
>
> But msvc documentation [1] says clearly that
> undefined behavior can occur.
It seems that we should have "Assert(word != 0);" at the top, which matches
the other platforms anyway, so I'll add that.
> Fix by checking the result of the function to avoid
> a possible undefined behavior.
No other platform does this, and that is by design. I'm also not
particularly impressed by the unrelated cosmetic changes.
--
John Naylor
EDB: http://www.enterprisedb.com