c2lang/c2compiler

TODO with source line number?

Closed this issue · 8 comments

Sometimes receiving compiler error like

building target rcrpg
Exit due to TODO in /Projects/c2/c2compiler/c2c/Analyser/LiteralAnalyser.cpp:205:checkLiterals()
<<
Not sure if it is possible, but maybe it would be helpful to see the originating source line number to figure out if a workaround for not implemented features in the compiler are possible?

I think that might indeed be nice. I don't think it's too hard to implement. I'll look into it..

Can you share the code you were trying to build? Maybe I can just fix the TODO instead of extending it..

here you go, please don't judge, I am just playing around by porting some C code (this one from Rosetta Code) to C2 for getting familiar with syntax, etc ;-)

rcrpg.c2.txt
recipe.txt

cool a game! that makes debugging a lot more fun ;)

I fixed one issue in c2c. These mainly have to do with AliasTypes. I almost never use them, so they are a bit under-tested. I modified the random() function to remove the float. That bypasses that limitation of c2c now. Now you're back to plain old compile errors... Please pull and rebuild..
rcrpg.c2.txt

Had some issues compiling it after llvm updated and forgot a z3 dependency ...
unfortunately the new c2 is still running into the TODO in /Projects/c2/c2compiler/c2c/Analyser/LiteralAnalyser.cpp:205:checkLiterals()

With the updated rcrpg.c2.txt I added in my last post?

oh, sorry, tried with my old one, missed that attachment. with the one you provided works better, now I can continue porting the C to C2. Thanks a lot :-)