www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/08/07/12:40:19

Xref: news2.mv.net comp.os.msdos.djgpp:6876
From: Erik Max Francis <max AT alcyone DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: time_t question
Date: Mon, 05 Aug 1996 18:30:12 -0700
Organization: Alcyone Systems
Lines: 18
Message-ID: <3206A024.657A93E2@alcyone.com>
References: <3205D6E7 DOT 167EB0E7 AT dra DOT hmg DOT gb>
NNTP-Posting-Host: annex-p136.meer.net
Mime-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Ian Miller wrote:

> I notice that time(), as required by ANSI C, returns -1 if
> the time is not available, but that its return type, time_t,
> is unsigned int. Of course the time *is* available in djgpp
> so this does not really matter. I just wonder why time_t is
> not a signed type.

You had the answer and let it go:  Because the time _is_ available under DJGPP
with the ANSI C time function.  That condition is intended for platforms where
such a facility is not available.  In that case, on those platforms, you'd
just defined time_t as a signed integral type and their implemented time
function would automatically return (time_t) -1.

-- 
Erik Max Francis, &tSftDotIotE   http://www.alcyone.com/max/   max AT alcyone DOT com
San Jose, California   ICBM 37 20 07 N 121 53 38 W   R^4: the 4th R is respect
War's a game which were their subjects wise/Kings would not play at. -- Cowper

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019