On Aug  3, 2003, Neil Booth <[EMAIL PROTECTED]> wrote:

> Alexandre Oliva wrote:-
>> Then we'll have to fix the integrated preprocessor to do whatever you
>> consider to be correct.  This patch only arranges for the separate 
>> preprocessor to match what the integrated one does as far as the
>> compiler computes the line of a declaration.

> Please post an example of input and how it looks on output before
> and after.

#define FOOx(x) int x ## _; \
int x
#define FOO(x) FOOx(x\
)
FOO(bar
)
;
# 1 "t.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "t.c"




int bar_; int bar

;
# 1 "t.c"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "t.c"





int bar_; int bar
;
Debug info with integrated preprocessor, before and after:

     DW_AT_name        : bar_
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 6
     DW_AT_type        : <37>
     DW_AT_external    : 1
[...]
     DW_AT_name        : bar
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 7
     DW_AT_type        : <37>
     DW_AT_external    : 1

     DW_AT_name        : bar_
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 6
     DW_AT_type        : <71>
     DW_AT_external    : 1
[...]
     DW_AT_name        : bar
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 7
     DW_AT_type        : <71>
     DW_AT_external    : 1

With separate preprocessor, before and after:

     DW_AT_name        : bar_
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 5
     DW_AT_type        : <37>
     DW_AT_external    : 1
[...]
     DW_AT_name        : bar
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 7
     DW_AT_type        : <37>
     DW_AT_external    : 1

     DW_AT_name        : bar_
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 6
     DW_AT_type        : <71>
     DW_AT_external    : 1
[...]
     DW_AT_name        : bar
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 7
     DW_AT_type        : <71>
     DW_AT_external    : 1

>> > Does this break people preprocessing Fortran?
>> 
>> I've no idea.  How do I tell?

> I know that changes in this area have before.  Maybe check through
> past PRs and mails to the mailing lists?

Bug 5289 is not changed at all.  The patch lets line breaks through
that were present in macro arguments, not in the macro definition or
parameter list, since these never make it to the token stream anyway,
(macros never contain line breaks after backslash-linebreak
processing) and, even if they did, they wouldn't be in the primary
context.  This patch enables the cppout's notion of current line
number to be in sync with the preprocessor's notion.  The difference
came from the fact that cb_line_change in c-lex.c doesn't take
parsing_args into account, whereas that in c-ppoutput.c does.  I
suppose it might also work to take parsing_args into account in
c-lex.c:cb_line_change, but this would be a change in behavior in the
integrated preprocessor used by default, so it could affect the
testsuite.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 [EMAIL PROTECTED], gcc.gnu.org}
CS PhD student at IC-Unicamp        [EMAIL PROTECTED], gnu.org}
Free Software Evangelist                Professional serial bug killer
__ 
distcc mailing list            http://distcc.samba.org/
To unsubscribe or change options: 
http://lists.samba.org/cgi-bin/mailman/listinfo/distcc

Reply via email to