-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
parser: Don't abort when warning about mismatching parameter initiali…
…zers Since the "mismatching parameter initializers" warning was added in 301962f, it also caused hCheckPrototype() to abort, which caused cProcHeader() to do "return CREATEFAKE( )" which it normally only does for error recovery. 1. This should just be warning though, not an error. 2. The symbol created by CREATEFAKE() is not completely the same as what would be produced in the absence of errors; for example it will use a temporary identifier instead of the original. Because of this, the newly added "warning" could even cause procedure bodies to be emitted under an incorrect name, resulting in linker errors.
- Loading branch information
Showing
5 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
' TEST_MODE : COMPILE_AND_RUN_OK | ||
|
||
'' This should just show the "parameter initializer mismatch" warning, but not | ||
'' cause any errors. | ||
|
||
type UDT | ||
i as integer | ||
declare sub s(byval i0 as integer = 0) | ||
end type | ||
|
||
sub UDT.s(byval i0 as integer = 1) | ||
i = i0 | ||
this.i = i0 | ||
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
' TEST_MODE : COMPILE_AND_RUN_OK | ||
|
||
'' This should just show the "parameter initializer mismatch" warning, but not | ||
'' cause any compiler/linker errors. | ||
|
||
declare sub f(byval i as integer = 0) | ||
|
||
sub f(byval i as integer = 1) | ||
end sub | ||
|
||
f() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
'' This should just show the "parameter initializer mismatch" warning, but not | ||
'' cause any errors. | ||
|
||
#print "1 warning:" | ||
|
||
type UDT | ||
i as integer | ||
declare sub s(byval i0 as integer = 0) | ||
end type | ||
|
||
sub UDT.s(byval i0 as integer = 1) | ||
i = i0 | ||
this.i = i0 | ||
end sub |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
1 warning: | ||
Mismatching parameter initializer, at parameter 1 (i0) of s() |