Avoid undefined behavior with msvc compiler (src/include/port/pg_bitutils.h)

Поиск
Список
Период
Сортировка
От Ranier Vilela
Тема Avoid undefined behavior with msvc compiler (src/include/port/pg_bitutils.h)
Дата
Msg-id CAEudQAoDhUZyKGJ1vbMGcgVUOcsixe-=jcVaDWarqkUg163D2w@mail.gmail.com
обсуждение исходный текст
Ответы Re: Avoid undefined behavior with msvc compiler (src/include/port/pg_bitutils.h)
Список pgsql-hackers
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.

Fix by checking the result of the function to avoid
a possible undefined behavior.

patch attached.

best regards,
Ranier Vilela

Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: logical decoding and replication of sequences, take 2
Следующее
От: Tomas Vondra
Дата:
Сообщение: Re: logical decoding and replication of sequences, take 2