Re: cast pid_t to int when using *printf

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Neil Conway <neilc(at)samurai(dot)com>, Oliver Jowett <oliver(at)opencloud(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: cast pid_t to int when using *printf
Date: 2004-10-09 02:42:47
Message-ID: 200410090242.i992glu02408@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Neil Conway <neilc(at)samurai(dot)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(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2004-10-09 02:51:19 Re: cast pid_t to int when using *printf
Previous Message Bruce Momjian 2004-10-09 02:42:00 Re: cast pid_t to int when using *printf