This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Re: RFA: Ignore DOS end-of-line characters (ctrl-Z) unless -W



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.

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.)


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