-
Notifications
You must be signed in to change notification settings - Fork 150
Allow parameter list to be a single "void" #204
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
Conversation
ChAoSUnItY
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests in tests/driver.sh to validate your work follows specification's description.
|
The current shecc also contains functions such as |
ChAoSUnItY
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rebase the latest master branch and resolve the error.
d025779 to
2649b08
Compare
A parameter list is either a single keyword "void" or a comma-separated list of parameters according to the standard. Previously, only the latter is supported, and the former leads to unexpected token errors.
'void' must be the only parameter and unnamed to indicate no parameters. Previously, the check for functions with first parameter of void pointer, etc. didn't consider the illegal forms, so those could pass compilation.
Adds the keyword "void" to the parameter lists of functions. This helps validation of the implementation of "void" parameter lists in the bootstrapping process. Especially K&R style exists until C23, though it's not implemented in shecc now, shecc is first built by another compiler such as gcc and is written in C99 (as per Makefile). Suggested-by: Yu-En Hsiao <[email protected]>
2649b08 to
fb762cd
Compare
|
Thank @lumynou5 for contributing! |
A parameter list is either a single keyword "void" or a comma-separated list of parameters according to the standard. Previously, only the latter is supported, and the former leads to unexpected token errors.
Summary by Bito
This pull request significantly enhances the parser by allowing a single 'void' keyword as a valid parameter list, resolving unexpected token errors and standardizing function signatures across multiple files. New tests have been added to ensure robust handling of parameter declarations.Unit tests added: True
Estimated effort to review (1-5, lower is better): 2 - The changes are clear and well-documented, making the review process straightforward.