| От | Tom Lane |
|---|---|
| Тема | Re: cast pid_t to int when using *printf |
| Дата | |
| Msg-id | 21288.1096035202@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Re: cast pid_t to int when using *printf (Neil Conway <neilc@samurai.com>) |
| Ответы |
Re: cast pid_t to int when using *printf
|
| Список | pgsql-patches |
Neil Conway <neilc@samurai.com> writes:
> I guess it would be safest to use %ld and cast pid_t to long. Of course,
> this seems a little paranoid -- is there actually a system with
> sizeof(pid_t) != 4?
Traditionally PIDs fit in 16 bits, let alone 32. I'd recommend that we
standardize on casting pid_t to int for printing purposes; I think
that's what's being done in more places than not. Also, as you note, we
are using int variables to hold PIDs in many places --- I don't think
it's worth running around and changing those either.
regards, tom lane
В списке pgsql-patches по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера