Re: warning: dereferencing type-punned pointer

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: warning: dereferencing type-punned pointer
Дата
Msg-id 1251525.1721843288@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: warning: dereferencing type-punned pointer  (Peter Eisentraut <peter@eisentraut.org>)
Список pgsql-hackers
Peter Eisentraut <peter@eisentraut.org> writes:
> This is basically the textbook example of aliasing violation, isn't it? 
> Wouldn't it be just as simple to do

> memcpy(&file_crc, &disk_state, sizeof(file_crc));

+1.  Also, it seems thoroughly bizarre to me that this case is handled
before checking for read failure.  I'd move the stanza to after the
"if (readBytes < 0)" one.

            regards, tom lane



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: [18] Policy on IMMUTABLE functions and Unicode updates
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: warning: dereferencing type-punned pointer