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

Merged
merged 2 commits into from
Dec 11, 2024
Merged

Fix compilation issues #586

merged 2 commits into from
Dec 11, 2024

Conversation

omircon
Copy link
Contributor

@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
@alexmucde alexmucde added this to the Release v2.28.0 milestone Dec 6, 2024
@alexmucde alexmucde merged commit bfa52d1 into COVESA:master Dec 11, 2024
4 checks passed
@omircon omircon deleted the fm/missingIncludes branch December 11, 2024 15:18
@LocutusOfBorg
Copy link
Contributor

thanks for fixing, Ubuntu build was just bitten by this issue
https://launchpadlibrarian.net/763274632/buildlog_ubuntu-plucky-amd64.dlt-viewer_2.27.0+dfsg-1_BUILDING.txt.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants