Re: Pointer subtraction with a null pointer

Поиск
Список
Период
Сортировка
От Isaac Morland
Тема Re: Pointer subtraction with a null pointer
Дата
Msg-id CAMsGm5ck5rfhE=MU+frgdEfUL8pHZBkkP=bBHXuHZzDXTcF_2w@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Pointer subtraction with a null pointer  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Sat, 26 Mar 2022 at 12:24, Andres Freund <andres@anarazel.de> wrote:
 
NULL can never be part of the same "array object" or one past past the last
element as the pointer it is subtracted from. Hence the undefined beaviour.

Even more fundamentally, NULL is not 0 in any ordinary mathematical sense, even though it can be written 0 in source code and is often (but not always) represented in memory as an all-0s bit pattern. I'm not at all surprised to learn that arithmetic involving NULL is undefined.

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Pointer subtraction with a null pointer
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Pointer subtraction with a null pointer