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

Fix compilation issues #586

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

omircon
Copy link

@omircon omircon commented Nov 20, 2024

Commit 1: Add missing includes

Why:
Without the missing includes, we had incomplete types.

What:
Added the necessary includes to resolve the incomplete types issue.

Commit 2: Set C standard to c11

Why:
dlt_common.c includes <QtGlobal> which implicitly includes <qtypes.h>, which contains a static_assert that requires the C11 standard. This was causing issues with the GCC compiler, which does not support static_assert in earlier C standards.

What:
Explicitly set the C standard to C11 to ensure compatibility with the static_assert usage in the code.

Without them we had incomplete types.
This is needed, because dlt_common.c includes `<QtGlobal>` which includes
implicitly `<qtypes.h>` which contains
```
static_assert(sizeof(ptrdiff_t) == sizeof(size_t), "Weird ptrdiff_t and size_t definitions");
...
```
But `static_assert` in C is available only from c11 standard.
Though this is working with clang, but not with gcc compiler, so we set
the standard explicitly to c11.
@omircon omircon marked this pull request as ready for review November 20, 2024 09:09
@omircon omircon changed the title Add missing includes Fix compilation issues Nov 20, 2024
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.

1 participant