Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com X-Authentication-Warning: slinky.cs.nyu.edu: pechtcha owned process doing -bs Date: Tue, 14 Oct 2003 14:04:39 -0400 (EDT) From: Igor Pechtchanski Reply-To: cygwin AT cygwin DOT com To: Alex Vinokur cc: cygwin AT cygwin DOT com Subject: Re: clock_t & return -1 In-Reply-To: Message-ID: References: Importance: Normal MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII On Tue, 14 Oct 2003, Alex Vinokur wrote: > # ------ man clock (fragments) ------ > # RETURNS > # The amount of processor time used so far by your program, in units > # defined by the machine-dependent macro `CLOCKS_PER_SEC'. > # If no measurement is available, the result is `-1'. > > So, clock() is unsigned and never returns -1 (?!) > > If one must write > ---------------------------------- > if (!(clock () == (clock_t)(-1))); > ---------------------------------- > I think it is worth noting that in the manual. The above is always good practice anyway. Besides, it seems they do it this way in a few other places as well: IOW, this is not Cygwin specific. FWIW, you're welcome to submit a patch to the cygwin-doc package. Igor -- http://cs.nyu.edu/~pechtcha/ |\ _,,,---,,_ pechtcha AT cs DOT nyu DOT edu ZZZzz /,`.-'`' -. ;-;;,_ igor AT watson DOT ibm DOT com |,4- ) )-,_. ,\ ( `'-' Igor Pechtchanski, Ph.D. '---''(_/--' `-'\_) fL a.k.a JaguaR-R-R-r-r-r-.-.-. Meow! "I have since come to realize that being between your mentor and his route to the bathroom is a major career booster." -- Patrick Naughton -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/