reopen 952718
tag 952718 upstream
thanks
Hi,
On 28/02/2020 19:11, Lisandro Damián Nicanor Pérez Meyer wrote:
>> * What outcome did you expect instead?
>>
>> I expect the clang code model to work out of the box with all depends
>> and recommends dependencies of `qtcreator`.
>> As of now, `libclang-common-8-dev` seems required by the clang code
>> model to work correctly, but that package is not a direct or indirect
>> dependency of `qtcreator`.
>
> No, you ar emixing two things here.
>
> The clang code model is a plugin that uses clang's API to parse a
> source file and do checks over it, like missing headers. It does not
> requires clang headers.>
> What you saw is a project that needed a header not available in the
> system (or at least not for the selected toolchain). The same could
> happen if for example you install qtcreator but not qbase5-dev, and
> then you open a project that needs QString.
Actually, the error is about missing `stddef.h` header which should be available everywhere.
It happens with a simple program like this:
```
#include <stddef.h>
int main() {
return 0;
}
```
Using another computer with outdated packages, I noticed that:
- When having qtcreator 4.10.2-2 and no `libclang-common-8-dev` package installed,
a project with the above file in `main.cpp` configured to be compiled using cmake and gcc-9,
the clang code model works fine, there is no highlighted errors.
When I do Ctrl+Click on the stddef.h header, qtcreator opens
/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h
- After having upgraded qtcreator to 4.11.0-2, the code model now shows the error
about missing `stddef.h` for the same project and configuration (cmake + gcc-9).
When I do Ctrl+Click on the stddef.h header, despite being "not found", qtcreator opens the same file:
/usr/lib/gcc/x86_64-linux-gnu/9/include/stddef.h.
- If I downgrade qtcreator to 4.10.2-2 again, the error about `stddef.h` not found goes away.
I've attached a test project I used with gcc-9 compiler.
Great! Reopening and tagging accordingly.
Thanks a lot for the follow up!