-
Notifications
You must be signed in to change notification settings - Fork 0
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
Syntax of auto declarations #1
Comments
Thank you! This wasn't quite clear to me from the kbman alone, I'll definitely fix it in the compiler Just out of curiosity, has this compiler been useful for you? You seem to be somewhat connected in that area. |
Commit da85e36 implements the |
Hi, My own compiler (not on github) has a goal of generating code for retro 8-bit targets. Apart that it has nothing special. Recursive descent written in C. |
Oh nice, sounds like a fun project! |
Stack alignment issues (hopefully) fixed with adf8d94 |
Hello,
After having some discussion about the B language with unix experts on the TUHS mailing list it appears that the constant values in auto declarations are not initial values but vector dimensions.
The reference for this is Ken Thompson's language specification here:
https://www.bell-labs.com/usr/dmr/www/kbman.html
Later on, the B language was ported to the H6070 computer, and the spec was evolved to include brackets as described in this document, while changing the meaning of the constant to an unusual one :
https://www.bell-labs.com/usr/dmr/www/bref.pdf
So in your fibonacci example, the initial values of variables should be defined by assignment expressions at the beginning of the code. The syntax you have used here:
is in fact incorrect and means in normal C:
which makes no sense, but the actual required syntax is:
Best regards
The text was updated successfully, but these errors were encountered: