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

Make include paths to private files relative #946

Conversation

dhebbeker
Copy link
Contributor

Analog to #879

By removing etl/ from include paths (in #include statements), the path to the directory include/ doesn't need to be provided to the preprocessor as an include path if the files in include/etl/ are included by other means. This has no disadvantages.
Actually the form #include "..." is intended to be used for relative paths in the first place.

This is relevant if one wants to include the source files from include/etl only indirectly.

For example we use special generated header files which wrap the include statement of the vanilla header files with diagnostic commands. Those commands disable some compiler diagnostics for ETL's files and re-enable them after the file inclusion. Wrapper files are generated for every non-private header file. We provide the directory with the wrapper files as include path to the preprocessor instead of the normal include/ directory. Thus include statements like #include "etl/private/..." are invalid in that case.

This may be beneficial only in special cases like ours. But it should have no disadvantages. In contrary, it uses the #include "..." form as intended.

By removing `etl/` from include paths (in `#include` statements), the path to the directory `include/` doesn't need to be provided to the preprocessor as an include path if the files in `include/etl/` are included by other means.
This has no disadvantages.
Actually the form `#include "..."` is intended to be used for relative paths in the first place.

This is relevant if one wants to include the source files from `include/etl` only indirectly.

For example we use special generated header files which wrap the include statement of the vanilla header files with diagnostic commands.
Those commands allow to disable diagnostic for ETL's files and re-enable them after the file inclusion.
Wrapper files are generated for every non-private header file.
We provide the directory with the wrapper files as include path to the preprocessor instead of the normal `include/` directory.
Thus include statements like `#include "etl/private/..."` are invalid in that case.
Copy link

Review changes with SemanticDiff.

@jwellbelove
Copy link
Contributor

There are 622 lines in 63 files where this file path is used.

33 findings in 4 files of 375.

See 9369619 for explanation.
@dhebbeker
Copy link
Contributor Author

I added 08365d0 to accommodate all findings of "etl/" in all files which are in include/. For other files this should not be (as) relevant.

@jwellbelove jwellbelove changed the base branch from master to pull-request/#946-Make-include-paths-to-private-files-relative August 8, 2024 06:18
@jwellbelove jwellbelove merged commit 527359f into ETLCPP:pull-request/#946-Make-include-paths-to-private-files-relative Aug 8, 2024
63 checks passed
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

Successfully merging this pull request may close these issues.

2 participants