-
Notifications
You must be signed in to change notification settings - Fork 14
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
More changes to make includes scope smaller #29
base: master
Are you sure you want to change the base?
Conversation
* Get rid of a large list of includes in file d.h, and add only the needed H files in each C file. * Remove unused functions and defines. * Move #defines that are used by a single C file, into the C file. * Make functions static if they are only used internally in a C file. * Add some missing prototypes including missing `(void)` decls. * Move some prototypes to a more appropriate H file. * Add some FIXME comments.
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.
Could you resync? I had to make some changes to the python code in order to get it to work.
Generally I think that this smaller include scopes isn't such a great idea. I very intentionally include everything so as to prevent conflicts and to fix the include order. This change has caused no end of problems and to what benefit? The # of lines of code has increase, instability has increased and I don't think it compiles any faster. It is also a maintainace nightmare since any reoganization in headers touches a bunch of files.
So, I backed out the previous header change. It messed up the tests and the python code. The core problem is that DParser has dependencies between headers and #defines which are then checked e.g. D_ParserNode_User which cause hidden failures. The internal dependencies between the headers are also not If you really want to unravel this, we need to have a include/ directory with "public" headers which are used by consumers Generally I believe that the "include what you use" principle is a failure in practice. It increased toil and maintainance |
I am having second thoughts as well. If you feel the change is not beneficial, please feel free to reject it. Also, my apologies for the unintended consequences -- I was trying to wrap my mind around the code. Maybe it is better to have a sounder strategy about how to clean things up, as you mentioned above. There were some juicy bits in the PR, though: some functions being declared as static, some declarations being moved around (a function defined in util.c but declared on a different header), etc. How about you revert the patch to the point you feel comfortable and I send you smaller PRs for some of the changes? I would initially focus on these changes, with separate PRs:
|
(void)
decls.