Can't declare variables in for loops #2481
Replies: 6 comments
-
cc65 is mainly a C89/C90 compiler, with small additions here and there from newer standards. The ability to define variables in the for statement as well as defining variables anywhere but at the beginning of a block was introduced in C99, though. Thus, what you are asking for is an enhancement, but clearly not a bug. |
Beta Was this translation helpful? Give feedback.
-
Ah, I was working in C99 codebases mostly and there I was fully able to declare normal syntax |
Beta Was this translation helpful? Give feedback.
-
However we could drop this limitation with |
Beta Was this translation helpful? Give feedback.
-
Maybe the limitation should also be dropped with |
Beta Was this translation helpful? Give feedback.
-
Of course, feel free to work on it. ;) |
Beta Was this translation helpful? Give feedback.
-
Also maybe implement it to the cc65 standard
… On Aug 9, 2024, at 10:16 AM, spiro-trikaliotis ***@***.***> wrote:
However we could drop this limitation with --standard c99.
Of course, feel free to work on it. ;)
—
Reply to this email directly, view it on GitHub <#2477 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ATXERVHGZMLMJKDJCVWIAR3ZQTFNVAVCNFSM6AAAAABMGD7VXOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENZYGA2TEMZSGQ>.
You are receiving this because you authored the thread.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
When using cc65, I found myself unable to declare variables in for loops for example
This code:
Would not compile while in other compilers this almost always compiles
As well as the fact that this won't compile either:
Platform: MacOS
CC65: cc65 V2.19 - Git feb5026
Beta Was this translation helpful? Give feedback.
All reactions