From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 100159,805e0071ac25e02c X-Google-Attributes: gid100159,public X-Google-Thread: fc89c,805e0071ac25e02c X-Google-Attributes: gidfc89c,public X-Google-Thread: f6653,805e0071ac25e02c X-Google-Attributes: gidf6653,public X-Google-Thread: fcda7,805e0071ac25e02c X-Google-Attributes: gidfcda7,public X-Google-Thread: 10650a,805e0071ac25e02c X-Google-Attributes: gid10650a,public X-Google-Thread: fee84,805e0071ac25e02c X-Google-Attributes: gidfee84,public X-Google-Thread: 11035d,805e0071ac25e02c X-Google-Attributes: gid11035d,public X-Google-Thread: 115614,805e0071ac25e02c X-Google-Attributes: gid115614,public From: Peter Mayne Subject: Re: best UNIX OS as primary platform for UNIX system software develpoment? Date: 1996/09/06 Message-ID: <322F54A6.44FE@cao.mts.dec.com>#1/1 X-Deja-AN: 178745668 cache-post-path: stevo.stl.dec.com!unknown@nessus.cao.dec.com references: <4v2j4b$2bs@knot.queensu.ca> <32189D13.3834@arborsoft.com> content-type: text/plain; charset=us-ascii organization: Digital Equipment Corporation mime-version: 1.0 newsgroups: comp.unix.solaris,comp.sys.sun.misc,comp.sys.hp.hpux,comp.unix.internals,comp.unix.programmer,comp.unix.aix,comp.unix.osf.osf1,comp.sys.sgi.misc x-mailer: Mozilla 2.02I (WinNT; I) Ronald Fischer wrote: > > Urs Thuermann wrote: > > > What is the portable way to printf size_t, time_t, and so on values? > > On some machines, where int is 16 bit, size_t and time_t will be > > typedefed as long so %ld seems right. On most unices they are > > typedefed as int. > > > > Is there another portable way than > > > > time_t t; > > printf("%ld", (long)t); > > What about > printf(sizeof(long)==sizeof(time_t) ? "%ld" : "%d",t) Who said time_t is a scalar? It might be something else, mightn't it? Use ctime(3) or locatime(3) and print the results. -- PJDM Digital Equipment Corporation (Australia), Canberra, ACT ------------------------------------------------------------------------------- These are my opinions, and have nothing to do with Digital. I design Internet Service Providers. It's a job. .