Mail Archives: djgpp-workers/2002/05/08/09:28:07
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 -