In all of these, there is syntax error caused by the commented out line. Delete that commented line before the return, and then no error. Also, changing to a multiline comment (with /*... */) resolves.
It seems as if the compiler is trying to parse out the for loop even if it’s commented.
This got more complicated. I think I’ve discovered three issues that are semi-related. The PR now only addresses the first one.
Having semi-colons in single line comments breaks things. The PR addresses this and hopefully the CI shows no issues this time.
Multiline macro definitions have a similar issue with semicolons.
Single line comments are not always parsed correctly. For instance, using single line comments on a multi-line macro can still cause processor errors on commented code.
I think addressing (3) requires a better understanding of the processing than what I currently have (or have time for). I would think that whatever parses out multiline comments, should also handle single line comments. I haven’t found where that it is yet though. Fixing that might negate need for the change I made in this PR.
Addressing (2) might be more difficult, and maybe not worthwhile. I suspect multiline macros are used rarely, and even less with statements containing semi-colons. I think to fix would require explicit checks for #define state and \ terminators.
Here is a PG that can be used to show all three issues. In the currrent PG (before this PR is merged), it will error unless the line with the commented for loop is removed. Modifying to see the other two issues is explained in comments: