From 085d3c07bcc81ee4844eb95a7359b57b07b2da9a Mon Sep 17 00:00:00 2001 From: omircon Date: Wed, 20 Nov 2024 09:51:13 +0100 Subject: [PATCH 1/2] Add missing includes Without them we had incomplete types. --- src/mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 100ee7da..8cb91638 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -48,6 +48,8 @@ #include #include #include +#include +#include /** * From QDlt. From cf30a0e541f96d71f4494b4cfae550b6c93984c8 Mon Sep 17 00:00:00 2001 From: omircon Date: Wed, 20 Nov 2024 09:53:03 +0100 Subject: [PATCH 2/2] Set C standard to c11 This is needed, because dlt_common.c includes `` which includes implicitly `` 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. --- CMakeLists.txt | 2 ++ src/src.pro | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f285aa2a..a944af1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,8 @@ set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_C_STANDARD 11) + if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." FORCE) endif() diff --git a/src/src.pro b/src/src.pro index a3918dd1..3b42f1ea 100644 --- a/src/src.pro +++ b/src/src.pro @@ -6,7 +6,7 @@ QT_VER_MIN = $$member(QT_VERSION, 1) CONFIG += c++1z *-gcc* { - QMAKE_CFLAGS += -std=gnu99 + QMAKE_CFLAGS += -std=c11 QMAKE_CFLAGS += -Wall QMAKE_CFLAGS += -Wextra #QMAKE_CXXFLAGS += -pedantic