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

remove '-I.', and include headers using the relative path #3044

Open
elliefm opened this issue May 15, 2020 · 3 comments
Open

remove '-I.', and include headers using the relative path #3044

elliefm opened this issue May 15, 2020 · 3 comments
Assignees

Comments

@elliefm
Copy link
Contributor

elliefm commented May 15, 2020

I started this a long time ago, in 39dab7c, because our generated headers need their directory to be explicit to be correctly found during certain types of builds (which make distcheck checks, and therefore we need to succeed).

And it's fine having that comment in files that need those headers, but every so often we need to add a generated header to a file that doesn't already have any, and this detail gets missed and breaks distcheck again.

We can avoid tripping over this repeatedly by removing -I. completely, and updating every file to name its includes explicitly.

@elliefm
Copy link
Contributor Author

elliefm commented Jun 17, 2022

We have ~50 (by crude search) source files that #include <assert.h> (i.e. using angle brackets) instead of #include "assert.h" (double quotes).

At the moment, they get the correct assertions (ours) because of our abuse of -I. When we fix this issue, those source files will start using the wrong assertions (stdc) instead of ours.

So, as part of fixing all the #include "foo.h" lines to be #include "path/foo.h", we'll also need to fix up the #include <assert.h> lines to be #include "lib/assert.h" too.

@elliefm
Copy link
Contributor Author

elliefm commented Jan 23, 2023

@elliefm
Copy link
Contributor Author

elliefm commented Jan 23, 2024

This gets more complicated, because some headers get installed so that other code can be linked against libcyrus et al. These headers get installed to wherever they get installed to, with no extra lib/ subdirectory. If the installed headers include other installed headers by spelling it like #include "lib/foo.h", included header will not be found -- since it is not in a lib/ subdirectory relative to the first one.

So, even though spelling these includes as #include "lib/foo.h" works during a normal Cyrus build, it makes the headers that use that spelling unusable to other projects.

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