Re: Detecting pointer misalignment (was Re: pgsql: Implementation of subscripting for jsonb)
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Detecting pointer misalignment (was Re: pgsql: Implementation of subscripting for jsonb) |
| Дата | |
| Msg-id | 477102.1612747200@sss.pgh.pa.us обсуждение |
| Ответ на | Detecting pointer misalignment (was Re: pgsql: Implementation of subscripting for jsonb) (Tom Lane <tgl@sss.pgh.pa.us>) |
| Ответы |
Re: Detecting pointer misalignment (was Re: pgsql: Implementation of subscripting for jsonb)
|
| Список | pgsql-hackers |
I wrote:
> * Both clang and gcc seem to be happy with the same spelling of the
> function attribute, which is fortunate. However, I seriously doubt
> that bare "#ifdef __GNUC__" is going to be good enough. At the very
> least there's going to need to be a compiler version test in there,
> and we might end up needing to get the configure script involved.
After digging in gcc's release history, it seems they invented
"-fsanitize=alignment" in GCC 5, so we can make this work for gcc
by writing
#if __GNUC__ >= 5
(the likely() macro already uses a similar approach). Can't say
if that's close enough for clang too.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера