mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-30 19:35:51 +00:00
Give errors for certain illegal initializers.
This prohibits initializers in "extern" declarations within a function, and in the parameter declarations of non-prototyped functions. Here are examples illustrating these cases: int main(void) { extern int i = 50; } void f(i) int i = 60; { }
This commit is contained in:
parent
4c903a5331
commit
20f9170343
@ -4123,8 +4123,11 @@ else {if not isFunction then} begin
|
||||
Error(141);
|
||||
if token.kind = eqch then begin
|
||||
if declSpecifiers.storageClass = typedefsy then
|
||||
Error(52);
|
||||
if doingPrototypes then
|
||||
Error(52)
|
||||
else if declSpecifiers.storageClass = externsy then
|
||||
if doingFunction then
|
||||
Error(22);
|
||||
if doingPrototypes or doingParameters then
|
||||
Error(88);
|
||||
{allocate copy of incomplete array type,}
|
||||
tp := variable^.itype; {so it can be completed by Initializer}
|
||||
|
Loading…
x
Reference in New Issue
Block a user