www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/22/15:34:32

From: "A. Sinan Unur" <asu1 AT cornell DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Bug using Delay()...
Date: Tue, 22 Apr 1997 09:55:01 -0400
Organization: Cornell University http://www.cornell.edu
Sender: asu1 AT cornell DOT edu (Verified)
Message-ID: <335CC334.4862@cornell.edu>
References: <335C96C2 DOT 369F AT csc DOT liv DOT ac DOT uk>
Reply-To: asu1 AT cornell DOT edu
NNTP-Posting-Host: cu-dialup-0027.cit.cornell.edu
Mime-Version: 1.0
Lines: 32
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Daniel Johnson wrote:
> 
> I recently came across an unusual bug, when running the following
> program under
> Windows 3.1 :
> 
> #include <stdio.h>
> #include <stdlib.h>
> 
> int main(void) {
>   delay(2500);
>   exit(0);
> }
> 
> It works fine when run under dos, but hangs the machine when run in a
> Windows dos box. 

i don't have 3.x installed any more so i could not test it there. it
works fine under win 95, though. would including the correct prototype
(declared in dos.h) make any difference by any chance? if you compile
the code above using -Wall, you will see:

delayt.c:5: warning: implicit declaration of function `delay'

   -- Sinan
 
*******************************************************************
 A. Sinan Unur                                WWWWWW
                                              |--O+O
 mailto:sinan DOT unur AT cornell DOT edu                C   ^ 
 http://www.people.cornell.edu/pages/asu1/     \  ~/ 
*******************************************************************

- Raw text -


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