public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc simple program crashing
@ 2003-09-07  8:00 Gerry Reno
  2003-09-07 11:24 ` Hartmut Welpmann
  0 siblings, 1 reply; 3+ messages in thread
From: Gerry Reno @ 2003-09-07  8:00 UTC (permalink / raw)
  To: cygwin

  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/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc simple program crashing
  2003-09-07  8:00 gcc simple program crashing Gerry Reno
@ 2003-09-07 11:24 ` Hartmut Welpmann
  2003-09-07 17:30   ` Gerry Reno
  0 siblings, 1 reply; 3+ messages in thread
From: Hartmut Welpmann @ 2003-09-07 11:24 UTC (permalink / raw)
  To: Gerry Reno; +Cc: cygwin

On Sun, 7 Sep 2003 01:00:17 -0700 (PDT), you wrote:

>  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

[...]

>Anyone know what is causing this behavior?  

You try to execute an object file, just remove the -c switch.

>Another poster with this
>problem was using g++ (GCC) 3.1.1 20020718 (prerelease):
>http://www.cygwin.com/ml/cygwin/2002-07/msg01598.html

If you had read the whole thread, you might have found the answer
yourself...

Regards,
Hartmut

-- 
Hartmut Welpmann

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gcc simple program crashing
  2003-09-07 11:24 ` Hartmut Welpmann
@ 2003-09-07 17:30   ` Gerry Reno
  0 siblings, 0 replies; 3+ messages in thread
From: Gerry Reno @ 2003-09-07 17:30 UTC (permalink / raw)
  To: cygwin; +Cc: Hartmut Welpmann

Hartmut,
  Yes, thanks.  This is what I get for working too late :-)

rgds,
Gerry Reno

  
--- Hartmut Welpmann <hartmut.welpmann@gmx.de> wrote:
> On Sun, 7 Sep 2003 01:00:17 -0700 (PDT), you wrote:
> 
> >  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
> 
> [...]
> 
> >Anyone know what is causing this behavior?  
> 
> You try to execute an object file, just remove the -c switch.
> 
> >Another poster with this
> >problem was using g++ (GCC) 3.1.1 20020718 (prerelease):
> >http://www.cygwin.com/ml/cygwin/2002-07/msg01598.html
> 
> If you had read the whole thread, you might have found the answer
> yourself...
> 
> Regards,
> Hartmut
> 
> -- 
> Hartmut Welpmann


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-09-07 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-07  8:00 gcc simple program crashing Gerry Reno
2003-09-07 11:24 ` Hartmut Welpmann
2003-09-07 17:30   ` Gerry Reno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).