ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2002/05/08/09:28:07

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 <pavenis AT latnet DOT lv>
To: Nick Clifton <nickc AT cambridge DOT redhat DOT com>, 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: <m3helilwi9.fsf@north-pole.nickc.cambridge.redhat.com>
Message-ID: <Pine.LNX.4.21.0205081622560.26436-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 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  <nickc AT cambridge DOT redhat DOT com>
> 
> 	* 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;
>         
> 
> 

- Raw text -


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