mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 07:30:54 +00:00
Change the name of the current source file on an #include or #append.
This causes __FILE__ to give the name of an include file if used within it, which seems to be what the standards intend (and what other compilers do). It also affects the file name recorded in debugging information for functions declared in an include file. (Note that occ will generate a #line directive before an #append, essentially to work around the problem this patch fixes. After the patch, such a #line directive is effectively ignored. This should be OK, although it may result in a difference in whether a full or partial pathname is used for __FILE__ and in debug info.)
This commit is contained in:
parent
dce9d36edd
commit
4cb2106ee4
@ -2164,6 +2164,7 @@ if gotName then begin {read the file name from the line}
|
||||
oldincludeFileGS := includeFileGS; {set the file name}
|
||||
includeFileGS.theString.theString := workString;
|
||||
includeFileGS.theString.size := length(workString);
|
||||
sourceFileGS := includeFileGS;
|
||||
ReadFile; {read the file}
|
||||
chPtr := bofPtr; {set the start, end pointers}
|
||||
eofPtr := pointer(ord4(bofPtr)+ffDCBGS.fileLength);
|
||||
|
2
cc.notes
2
cc.notes
@ -1731,6 +1731,8 @@ int foo(int[42]);
|
||||
|
||||
(Devin Reade)
|
||||
|
||||
177. The name of the current source file was not updated when processing an #include or #append. As a result, uses of the __FILE__ macro within an include file would not give the name of that file, and functions within an include file would not have the proper file name recorded in their debugging information.
|
||||
|
||||
-- Bugs from C 2.1.0 that have been fixed -----------------------------------
|
||||
|
||||
1. In some situations, fread() reread the first 1K or so of the file.
|
||||
|
Loading…
Reference in New Issue
Block a user