This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc simple program crashing


  I wrote, compiled and ran a very simple program today that is
producing the weirdest results.  I began googling the errors and came
across multiple accounts of people experiencing the exact same
behavior. The program is just a simple dos/unix line termination
converter:

#include <stdio.h>

int main (int argc, char *argv[])
{
  int ch;
  while ( (ch = getc(stdin)) && ! feof(stdin) ) {
    if (ch == '\n') {
      putc('\n',stdout);
      putc('\r',stdout);
    } else putc(ch,stdout);
  }
}

gcc -o filter.exe -c filter.c

The errors:
./filter.exe 8: Syntax error: EOF in backquote substitution

and sometimes:
----------------------------------------------
16-bit MS-DOS Subsystem
----------------------------------------------
~/dev
The NTVDM has encountered an illegal instruction.
CS:0000 IP:0077 OP:f0 37 05 0e 02 Choose 'Close' to terminate the
application.
----------------------------------------------

Also, when I run the program from a DOS box the cursor starts jumping
all over the screen and you have to kill the DOS box to stop it.

I've tried this under Cygwin and MinGW with same result.

I'm using gcc 3.2 series in both cases:

gcc --version
gcc.exe (GCC) 3.2.3 (mingw special 20030504-1)

gcc --version
gcc (GCC) 3.2 20020927 (prerelease)

  Anyone know what is causing this behavior?  Another poster with this
problem was using g++ (GCC) 3.1.1 20020718 (prerelease):
http://www.cygwin.com/ml/cygwin/2002-07/msg01598.html


thx,
Gerry Reno


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

--
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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]