cc65: Error in struct initialization
kugelfuhr opened this issue · comments
kugelfuhr commented
The following C89 compliant code should compile but doesn't:
struct s { int a, b; };
struct s s;
int main()
{
struct s t = s;
return 0;
}
Result with cc65 2.18:
test.c(5): Error: '{' expected
test.c(5): Error: Constant expression expected
test.c(5): Error: '}' expected
Result with current version:
test.c:5: Error: '{' expected
test.c:5: Error: Constant expression expected
test.c:5: Error: Converting to 'int' from 'struct s'
3 errors and 0 warnings generated.
acqn commented
There has been a pending post-IR fix....
In case you are wondering why it isn't to be fixed without an IR, here's the culprit(s): nested structs/unions, who need look-ahead parsing.
kugelfuhr commented
There has been a pending post-IR fix....
So I'll better wait with more reports until this is merged.
Bob Andrews commented
So I'll better wait with more reports until this is merged.
Please no, it'll take quite some time until that happens :)