X-Authentication-Warning: delorie.com: mailnull set sender to djgpp-workers-bounces using -f Date: Wed, 8 May 2002 16:27:29 +0300 (EEST) From: Andris Pavenis To: Nick Clifton , djgpp-workers AT delorie DOT com cc: gcc-patches AT gcc DOT gnu DOT org Subject: Re: RFA: Ignore DOS end-of-line characters (ctrl-Z) unless -W In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 Precedence: bulk On 8 May 2002, Nick Clifton wrote: > Hi Guys, > > 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. Andris > > Cheers > Nick > > 2002-05-08 Nick Clifton > > * c-lex.c (c_lex): Ignore ctrl-Z character unless -W has been > specified. > > Index: gcc/c-lex.c > =================================================================== > RCS file: /cvs/gcc/gcc/gcc/c-lex.c,v > retrieving revision 1.176 > diff -c -3 -p -w -r1.176 c-lex.c > *** gcc/c-lex.c 6 May 2002 22:52:57 -0000 1.176 > --- gcc/c-lex.c 8 May 2002 11:15:09 -0000 > *************** c_lex (value) > *** 747,753 **** > case CPP_OTHER: > if (ISGRAPH (tok->val.c)) > error ("stray '%c' in program", tok->val.c); > ! else > error ("stray '\\%o' in program", tok->val.c); > goto retry; > > --- 747,755 ---- > case CPP_OTHER: > if (ISGRAPH (tok->val.c)) > error ("stray '%c' in program", tok->val.c); > ! /* Ignore the DOS end-of-file character (ctrl-Z) > ! unless we are generating extra warnings. */ > ! else if (tok->val.c != '\032' || extra_warnings) > error ("stray '\\%o' in program", tok->val.c); > goto retry; > > >