delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/07/06/13:45:29

From: "Bradley A. Barrett" <bbarrett AT isr DOT umd DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Win32: RSXNTDJ works but here are some bugs(?)
Date: Mon, 6 Jul 1998 12:10:40 -0400
Organization: University of Maryland, College Park, MD
Lines: 46
Message-ID: <6nqsrm$aqe@dailyplanet.wam.umd.edu>
References: <359B9A42 DOT 3B9F AT hyperman DOT co DOT il>
NNTP-Posting-Host: bay1-29.dial.umd.edu
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Alain Rosenthal wrote in message <359B9A42 DOT 3B9F AT hyperman DOT co DOT il>...

>-3: the function feof() seems to provoke an error:
[...]
>Under DOS gcc it works fine
>Compiled with -Zwin32 -Zrsx32 , it produces an error!


I have encountered the same problem.  The following code works fine when
compiled as a DJGPP DOS program, but crashes at the first feof(infile) call
with "Exception at 0x00000000; Application got SIGSEGV" when compiled
with -Zwin32:

#include <stdio.h>
#include <stdlib.h>
main (int argc, char *argv[])
 {
 int c;
 FILE *infile;
  infile=fopen(argv[argc-1],"r"); {
    printf("Unable to open input file %s.\n\n",argv[argc-1]);
    exit;
   }
  while (!feof(infile)) {
    if ((c=getc(infile))==EOF)  {
      printf("\nEOF.\n"); fflush(stdout);
      break;
     }
    else putchar(c); fflush(stdout);
   }
 }


Does anyone know why this happens?  Is my RSXNTDJ installation not
configured right?

Brad

------
Bradley A. Barrett
bbarrett AT isr DOT umd DOT edu
bbarrett AT wam DOT umd DOT edu



- Raw text -


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