ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/08/13:01:05

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Message-ID: <3CD9512C.7EC15181@yahoo.com>
Date: Wed, 08 May 2002 12:24:12 -0400
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: RFA: Ignore DOS end-of-line characters (ctrl-Z) unless -W
References: <Pine DOT LNX DOT 4 DOT 21 DOT 0205081655590 DOT 26648-100000 AT gulbis DOT latnet DOT lv>
Reply-To: djgpp-workers AT delorie DOT com

Andris Pavenis wrote:
> On Wed, 8 May 2002, Eli Zaretskii wrote:
... snip ...
> >
> > I agree with Andris: the right thing is to stop reading at the
> > first ^Z character.  (A warning under -W is also okay, I think.)
> >
> > If ignoring everything after ^Z is somehow a problem, please
> > describe the situation where that problem happens.
> One situation is our problems with DJGPP. For this case
> preventing using input after ^Z in gcc/cppfiles.c is enough
> (enclosing related code in '#ifdef __DJGPP__' and '#endif'). I
> did it for DJGPP ports of gcc-3.0.X and will keep for gcc-3.1
> (had to update it as patch was slightly bitrotted)
> Original message (and patch) was due to a different reason: use
> of source files originated from DOS under other systems
> (unfortunatelly read initial message not too carefully ...)
> > Hmm, does this mean GCC reads files in binary mode?  (If not,
> > the library will stop at the first ^Z, and GCC itself will
> > never see any ^Zs.)
> It reads in binary mode.

So I think this patch to ignore all after a ^Z is essential.  Many
editors and other utilities install the ^Z EOF marker routinely. 
Some utilities (I have built some) use this to install auxiliary
data after the text file EOF marker, such as CRC checksums.

Why does GCC read in binary mode?

Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!

- Raw text -

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