delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/10/13:07:31

Date: Mon, 10 Jan 2000 18:51:14 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Andreas Matthies <andreas DOT matthies AT landsh DOT de>
cc: djgpp AT delorie DOT com
Subject: Re: redirection of stderr impossible?
In-Reply-To: <newscache$jeg4of$rsb$1@www>
Message-ID: <Pine.SUN.3.91.1000110184705.8930C-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: dj-admin AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 10 Jan 2000, Andreas Matthies wrote:

> gcc -c conftest.c 2>conftest.out
> This doesn't seem to work in djgpp. Output is always on screen, even 1>file
> doesn't work. I should mention that I use the bash of cygwin32 in a
> Windows32-environment, where redirection works pretty good. Only the
> compilers are the djgpp one's.

Redirection is performed by the shell, not by GCC.  Since you use the 
Cygwin port of Bash, I'd say that it's a bug in that port.  I just 
tried this with the DJGPP port of Bash, and the above command works like 
advertised.

I'm speculating that the problem is due to the fact that DJGPP programs 
are DOS programs, and Windows runs DOS programs in a separate Virtual 
Machine (VM).  Redirecting standard streams from a program that runs in 
another VM is tricky (for example, Windows 9X loads a special TSR into 
the same DOS box to make it work).  It seems that the Cygwin port of Bash 
doesn't do such trickery on behalf of DOS programs.

- Raw text -


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