Skip to content

Conversation

@carlosmn
Copy link
Member

@carlosmn carlosmn commented Aug 7, 2019

For quite a while we've had the issue that some type definitions were missing, most notably size_t when generating documentation for libgit2. We "solved" that by defining it ourselves when DOCURIUM is defined. This is clearly a terrible hack but we did not know what was happening.

Then in #39 we got errors about not finding stddef.h. Further investigation revealed that this was because that PR included a change to ask the library to print out errors.

It turns out that by default we do not include the directory in which clang stores its headers, which means we've been missing some necessary ones for quite some time now.

This PR queries clang for its include file by parsing its verbose output (inspiration from drothlis/clang-ctags#7) and passing it as an include path. We also remove -DDOCURIUM=1 as it should no longer be necessary.

We've been hiding missing includes for quite some time, which has caused us to
miss some issues.
We don't necessarily know where clang's includes are so execute the C compiler
and extract the relevant search path.

Without this, we end up not finding, among others, `stddef.h` meaning that
some types are not found.
This is no longer necessary as we now include the correct headers for llvm to
know what these basic types are.
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