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]

Re: [RFA:] Take 2: CPP: Correct (add) condition for calling debug_end_source_file


Would someone approve this, please?  It looks good to me, and I think
it fixes Andreas' -g -include bug.

Neil.

Hans-Peter Nilsson wrote:-

> If I understand you correctly, this is a patch for what you describe.
> It passes bootstrap and no regressions on i686-pc-linux-gnulibc1.
> 
> Ok to commit?
> 
> 	* c-lex.c (cb_leave_file): Harmonize conditions and order of
> 	statements to those of process_directive for (action == act_pop).
> 
> Index: c-lex.c
> ===================================================================
> RCS file: /cvs/gcc/egcs/gcc/c-lex.c,v
> retrieving revision 1.107
> diff -p -c -r1.107 c-lex.c
> *** c-lex.c	2000/11/02 08:05:44	1.107
> --- c-lex.c	2000/11/07 14:43:12
> *************** cb_leave_file (pfile)
> *** 728,757 ****
>   {
>     /* Bleah, need a better interface to this.  */
>     const char *flags = cpp_syshdr_flags (pfile, CPP_BUFFER (pfile));
> ! #if 0
> !   if (indent_level != input_file_stack->indent_level)
> !     {
> !       warning_with_file_and_line
> ! 	(input_filename, lex_lineno,
> ! 	 "This file contains more '%c's than '%c's.",
> ! 	 indent_level > input_file_stack->indent_level ? '{' : '}',
> ! 	 indent_level > input_file_stack->indent_level ? '}' : '{');
> !     }
> ! #endif
> !   /* We get called for the main buffer, but we mustn't pop it.  */
>     if (input_file_stack->next)
> -     pop_srcloc ();
> -   in_system_header = (flags[0] != 0);
> - #ifndef NO_IMPLICIT_EXTERN_C
> -   if (c_header_level && --c_header_level == 0)
>       {
> !       if (flags[2] != 0)
> ! 	warning ("badly nested C headers from preprocessor");
> !       --pending_lang_change;
> !     }
>   #endif
>     lex_lineno = CPP_BUFFER (pfile)->lineno;
> -   debug_end_source_file (input_file_stack->line);
>   
>     update_header_times (input_file_stack->name);
>     /* Hook for C++.  */
> --- 728,761 ----
>   {
>     /* Bleah, need a better interface to this.  */
>     const char *flags = cpp_syshdr_flags (pfile, CPP_BUFFER (pfile));
> ! 
>     if (input_file_stack->next)
>       {
> ! #ifndef NO_IMPLICIT_EXTERN_C
> !       if (c_header_level && --c_header_level == 0)
> ! 	{
> ! 	  if (flags[2] != 0)
> ! 	    warning ("badly nested C headers from preprocessor");
> ! 	  --pending_lang_change;
> ! 	}
> ! #endif
> ! #if 0
> !       if (indent_level != input_file_stack->indent_level)
> ! 	{
> ! 	  warning_with_file_and_line
> ! 	    (input_filename, lex_lineno,
> ! 	     "This file contains more '%c's than '%c's.",
> ! 	     indent_level > input_file_stack->indent_level ? '{' : '}',
> ! 	     indent_level > input_file_stack->indent_level ? '}' : '{');
> ! 	}
>   #endif
> +       /* We get called for the main buffer, but we mustn't pop it.  */
> +       pop_srcloc ();
> +       debug_end_source_file (input_file_stack->line);
> +     }
> + 
> +   in_system_header = (flags[0] != 0);
>     lex_lineno = CPP_BUFFER (pfile)->lineno;
>   
>     update_header_times (input_file_stack->name);
>     /* Hook for C++.  */
> 
> brgds, H-P
> 

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