-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Forward Declaration #48
Comments
You can create a list to save the address of these jump address in code segment that declared but not defined function calls, and function's hash too. Then fill these address after parsing the whole file. Of course, parsing declarations is necessary. |
Without changes to c4, you cannot forward declare. The changes are not insignificant to make it work. You could instead try reordering your functions so that they don't need forward declarations. |
When you call functions mutually, forward declarations will be necessary. What I said is the way to change c4. |
Before discussing call mutually, I don't think it's a good design which has interdependency. |
Most of the time, we do not need call functions mutually, or you can say it should be avoided. But sometimes, it's inevitable and convenient in some special cases like recursive descent or recursive implementation of AVL tree. |
How can I forward declare a function?
The text was updated successfully, but these errors were encountered: