🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.postscript
Article #7756

Re: ato2pps - possible bug

#7756
From: Unix Consultation Mailbox
Date: Wed, 21 Dec 1988 22:06
31 lines
1743 bytes
In article <1988Dec19.161813.788@mntgfx.mentor.com> chane@mntgfx.mentor.com (Chane Cullens  SPD Engr 526-5267) writes:
>From article <991@dogie.edu>, by edwards@dogie.edu ( Mark Edwards):
>>         t = time();
>Shouldn't this be "t = time( NULL );"

Close, and it will usually work.  But, it's not portable.  Assuming that
NULL is defined to 0, the call should be either

	t = time( (long *) NULL );

or

	t = time( (time_t *) NULL );

(I kept the uncomfortable coding style intact for consistency) depending
on whether you have the time_t typedef.  If NULL is not defined to 0, but
instead something completely wrong and warning-producing like (char *) 0,
beat the person responsible about the head and shoulders with a copy of
K&R (either edition).  If all else fails, the third possibility is

	(void) time( &t );

although this will cause some lints to say "long assignment may lose
accuracy" (hell yes, I'm trying to lose *all* the accuracy, you nitwit
program).

Oh yeah, be sure to declare t as long or time_t, whichever is more
appropriate.  The manpage shows this but lots of programmers get
complacent working on machines with 32-bit words.

Phil Kos        uunet!pyrdc!osiris!phil       The Johns Hopkins Hospital
Technical Details
Message-ID: <2747@osiris.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tank!mimsy!haven!aplcen!osiris!consult
References: <991@dogie.edu> <1988Dec19.161813.788@mntgfx.mentor.com>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tank!mimsy!haven!aplcen!osiris!consult
From: consult@osiris.UUCP (Unix Consultation Mailbox )
Newsgroups: comp.lang.postscript
Subject: Re: ato2pps - possible bug
Message-ID: <2747@osiris.UUCP>
Date: 21 Dec 88 22:06:21 GMT
References: <991@dogie.edu> <1988Dec19.161813.788@mntgfx.mentor.com>
Reply-To: consult@osiris.UUCP (Unix Consultation Mailbox (Phil))
Distribution: comp
Organization: The Johns Hopkins Hospital, Information Systems
Lines: 31