Skip to content
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

Allow function declarations to be included #3

Open
mcandre opened this issue Aug 29, 2021 · 0 comments
Open

Allow function declarations to be included #3

mcandre opened this issue Aug 29, 2021 · 0 comments

Comments

@mcandre
Copy link

mcandre commented Aug 29, 2021

Hi,

A common pattern in C/C++ is to define function signatures in a separate .h[pp] file, and then include the signatures into the implementation .c[pp] file. Would be helpful for deheader to account for this common practice.

There may not necessarily be any symbols reused from such a header. Some headers may consist chiefly of a header guard macro and a docstring comment. Yet even so, the implementation conventionally needs to include this header.

Most of the time, the header serves simply to export the implemented functions into a reusable API. The header contains no additional information, but rather acts like a checksum in terms of making sure the function signatures are correct. Although deheader currently treats these headers as removable, in fact, their removal could break the API for downstream users.

For example, drop the file extension from the header basename. Drop the file extension from the implementation basename. If the two match, then it is very likely safe for deheader to ignore this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant