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

libclang parses like a C compiler #35

Closed
theHolgi opened this issue Sep 16, 2022 · 0 comments · Fixed by #36
Closed

libclang parses like a C compiler #35

theHolgi opened this issue Sep 16, 2022 · 0 comments · Fixed by #36
Labels
bug Something isn't working

Comments

@theHolgi
Copy link
Contributor

I looks like libclang incorporates a "C" compiler when parsing the sources.
This is a problem since the generated mockup.cc file will be compiled as C++; headers may parse differently dependent on the mode.

For example, the bool type from <stdbool.h> is #defined to int when parsed by libclang, but is a native type _Bool in C99 and C++ mode.

[build] /build/some_test/mockup.cc:21:5: error: functions that differ only in their return type cannot be overloaded
[build] int func_x(uint8_t arg){
[build] ~~~ ^
[build] /project/include/some_include.h:65:6: note: previous declaration is here
[build] bool func_x(uint8_t arg);
[build] ~~~~ ^

We need to control the compiler that libclang incorporates to be the same C++ compiler that will compile the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant