mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-03-13 04:33:19 +00:00
Fix bug causing some #undefs to be ignored when using a sym file.
This would occur if the macro had already been saved in the sym file and the #undef occurred before a subsequent #include that was also recorded in the sym file. The solution is simply to terminate sym file generation if an #undef of an already-saved macro is encountered. Here is an example showing the problem: test.c: #include "test1.h" #undef x #include "test2.h" int main(void) { #ifdef x return x; #else return y; #endif } test1.h: #define x 27 test2.h: #define y 6
This commit is contained in:
parent
b231782442
commit
5d7c002819
@ -18,7 +18,7 @@ uses CCommon, MM, Scanner, Symbol, CGI;
|
||||
{$segment 'SCANNER'}
|
||||
|
||||
const
|
||||
symFileVersion = 21; {version number of .sym file format}
|
||||
symFileVersion = 22; {version number of .sym file format}
|
||||
|
||||
var
|
||||
inhibitHeader: boolean; {should .sym includes be blocked?}
|
||||
|
@ -2943,6 +2943,8 @@ var
|
||||
bPtr^ := mPtr^.next
|
||||
else
|
||||
lastPtr^.next := mPtr^.next;
|
||||
if mPtr^.saved then
|
||||
TermHeader;
|
||||
end; {else}
|
||||
goto 1;
|
||||
end; {if}
|
||||
|
2
cc.notes
2
cc.notes
@ -1775,6 +1775,8 @@ int foo(int[42]);
|
||||
|
||||
179. Macro definitions or header search paths specified via the cc= portion of the command line could be saved in the .sym file and applied to subsequent compilations, even if they were no longer specified on the command line.
|
||||
|
||||
180. Certain #undef directives might be ignored when using a .sym file.
|
||||
|
||||
-- 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…
x
Reference in New Issue
Block a user