-
Notifications
You must be signed in to change notification settings - Fork 746
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Various problems. #35
Comments
Nothing in the code looks too crazy, though large parts of the code are being rewritten atm so the issue might need to wait until after the rewrite. I'll make a smaller test case out of your code later though, it might be useful to fill holes in the 8cc test suite. I'll add it onto a branch on my own fork so I don't forget about it. |
Heh, if you want crazy I can do that too ... https://gist.github.com/rdebath/2120d506bda710a76dd6 This one seems to work correctly, however, it doesn't get any constant folding done on it so the binary is a bit large (but the memory it needs to compile isn't too bad). TODO: Constant folding of expressions like: x[4] += 1+1+1+1+1+1+1+1+1;
si.flg = 4096+256+64+2+1; |
This compiler has no serious test sets except the ones in test directory and the compiler itself. When I write new code for the compiler I sometimes found a miscompilation. So I wouldn't surprise that the code couldn't be compiled correctly with 8cc. I'll take a look later. |
I've just generated this piece of C code from a torture test of BF program interpreters. Obviously, being generated code it promises to be a bit of problem. I suspect this promise will be fulfilled.
https://gist.github.com/rdebath/ecd1454a259ece0a8ecf
The CPP define "C" can be declared, on the command line or inside, to be any integer type, signed or unsigned, for 8 bits to 128bits or more. The program, when run, should display one of a few variants of 'hello world' and then finish.
The default of integers complies and runs, but incorrectly.
Any type smaller then an integer gets a 'not an lvalue' error from a "-- * X" type construct.
Longs compile, but seem not to work at all, however, this appears to be a problem with 'stdint.h'.
Test run on Debian Wheezy.
The text was updated successfully, but these errors were encountered: