Re: cast pid_t to int when using *printf - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: cast pid_t to int when using *printf
Date
Msg-id 200410090242.i992glu02408@candle.pha.pa.us
Whole thread Raw
In response to Re: cast pid_t to int when using *printf  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: cast pid_t to int when using *printf
List pgsql-patches
Tom Lane wrote:
> 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;

Done.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: cast pid_t to int when using *printf
Next
From: Bruce Momjian
Date:
Subject: Re: cast pid_t to int when using *printf