Re: cast pid_t to int when using *printf

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: cast pid_t to int when using *printf
Дата
Msg-id 416799F7.6020500@opencloud.com
обсуждение исходный текст
Ответ на Re: cast pid_t to int when using *printf  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Bruce Momjian wrote:

> I see in include/sys/types.h on Solaris 9:
>
>     #if defined(_LP64) || defined(_I32LPx)
>     typedef uint_t nlink_t;                 /* file link type       */
>     typedef int     pid_t;                  /* process id type      */
>     #else
>     typedef ulong_t nlink_t;                /* (historical version) */
>     typedef long    pid_t;                  /* (historical version) */
>     #endif

> I am confused why you are seeing long for pid_t?  What is your Solaris
> system information?  If Solaris needs adjustments, there are a lot of
> place we print getpid().

This is also what is on the Solaris system I was using. gcc -E showed
that the #else branch was being taken. The #if branch is taken when
compiling in 64-bit mode (gcc -m64).

We're fine so long as everything casts to either int or long. I only saw
warnings from a couple of places that did not do a cast at all.

-O

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

Предыдущее
От: Neil Conway
Дата:
Сообщение: Re: cast pid_t to int when using *printf
Следующее
От: Devrim GUNDUZ
Дата:
Сообщение: (Turkish) New translation: pg_resetxlog, Updated translation: pg_ctl