Skip to content

Commit

Permalink
Merge pull request #586 from omircon/fm/missingIncludes
Browse files Browse the repository at this point in the history
* Add missing includes

Without them we had incomplete types.

* Set C standard to c11

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.
  • Loading branch information
alexmucde authored Dec 11, 2024
2 parents 2926b3a + cf30a0e commit bfa52d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include <QTextStream>
#include <QTemporaryFile>
#include <QtEndian>
#include <QDir>
#include <QDirIterator>

/**
* From QDlt.
Expand Down
2 changes: 1 addition & 1 deletion src/src.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfa52d1

Please sign in to comment.