Mail Archives: djgpp/1998/07/06/13:45:29
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 -