ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/08/10:03:11

X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f
Date: Wed, 8 May 2002 17:03:03 +0300 (EEST)
From: Andris Pavenis <pavenis AT latnet DOT lv>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
cc: Nick Clifton <nickc AT cambridge DOT redhat DOT com>, djgpp-workers AT delorie DOT com,
gcc-patches AT gcc DOT gnu DOT org
Subject: Re: RFA: Ignore DOS end-of-line characters (ctrl-Z) unless -W
In-Reply-To: <Pine.SUN.3.91.1020508164715.25387H-100000@is>
Message-ID: <Pine.LNX.4.21.0205081655590.26648-100000@gulbis.latnet.lv>
MIME-Version: 1.0
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com



On Wed, 8 May 2002, Eli Zaretskii wrote:

> 
> On Wed, 8 May 2002, Andris Pavenis wrote:
> 
> > >   Gcc will issue a warning message if a source file contains a DOS
> > >   end-of-file character (ctrl-Z).  The patch below silences this
> > >   warning, unless the -W (extra warnings) switch is used.  This will
> > >   allow source files created under DOS to be compiled without
> > >   prejudice.
> > > 
> > >   May I apply this patch please ?
> > 
> > For DJGPP (i[3456]86-pc-msdosdjgpp) I tried to truncate input after 
> > Ctrl-Z in gcc/cppfiles.c. ^Z is end-of-file for DOS anyway, so the
> > correct action should perhaps be ignoring rest of file.
> 
> 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.

Andris


- Raw text -


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