Skip to content

Fix compilation with GCC 13

Stephan Lachnit requested to merge slachnit/peary:p-gcc13-fix into master

Add missing header, fixes the following compilation problem:

FAILED: devices/CLICTD/CMakeFiles/PearyDeviceCLICTD.dir/CLICTDFrameDecoder.cpp.o 
/usr/bin/c++ -DIIO_EMULATED -DMEDIA_EMULATED -DPEARY_BUILD_TIME="\"2023-10-05, 15:05:48 UTC\"" -DPEARY_DEVICE_CLASS=CLICTDDevice -DPEARY_DEVICE_HEADER=\"CLICTDDevice.hpp\" -DPEARY_DEVICE_NAME=\"CLICTD\" -DPEARY_PROJECT_NAME=\"peary\" -DPEARY_PROJECT_VERSION="\"v0.12.0+8^gb1f006ac\"" -DPearyDeviceCLICTD_EXPORTS -DSPI_EMULATED -I/home/stephan/Projects/peary/build -I/home/stephan/Projects/peary/peary -I/home/stephan/Projects/peary/devices -I/home/stephan/Projects/peary/devices/CLICTD -I/home/stephan/Projects/peary/peary/interfaces/Media -fdiagnostics-color=auto -Wdeprecated -Wformat-security -Wshadow -Wundef -Wswitch-default -Wstrict-null-sentinel -Wsign-promo -Wsign-conversion -Wredundant-decls -Wold-style-cast -Wnoexcept -Wmissing-include-dirs -Wmissing-declarations -Wlogical-op -Winit-self -Wformat=2 -Wdisabled-optimization -Wzero-as-null-pointer-constant -Wctor-dtor-privacy -Wuseless-cast -Wconversion -Wcast-qual -Wcast-align -Wextra -Wall  -O3 -DNDEBUG -std=gnu++17 -fPIC -MD -MT devices/CLICTD/CMakeFiles/PearyDeviceCLICTD.dir/CLICTDFrameDecoder.cpp.o -MF devices/CLICTD/CMakeFiles/PearyDeviceCLICTD.dir/CLICTDFrameDecoder.cpp.o.d -o devices/CLICTD/CMakeFiles/PearyDeviceCLICTD.dir/CLICTDFrameDecoder.cpp.o -c /home/stephan/Projects/peary/devices/CLICTD/CLICTDFrameDecoder.cpp
In file included from /home/stephan/Projects/peary/devices/CLICTD/CLICTDFrameDecoder.hpp:6,
                 from /home/stephan/Projects/peary/devices/CLICTD/CLICTDFrameDecoder.cpp:1:
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:350:30: error: expected ‘)’ before ‘base_address’
  350 |     memory_map(std::uintptr_t base_address, std::size_t size, int flags = PROT_READ)
      |               ~              ^~~~~~~~~~~~~
      |                              )
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:352:10: error: ‘uintptr_t’ in namespace ‘std’ does not name a type
  352 |     std::uintptr_t getBaseAddress() const { return _base_address; }
      |          ^~~~~~~~~
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:13:1: note: ‘std::uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
   12 | #include <sys/mman.h>
  +++ |+#include <cstdint>
   13 | #include <tuple>
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:369:10: error: ‘uintptr_t’ in namespace ‘std’ does not name a type
  369 |     std::uintptr_t _base_address;
      |          ^~~~~~~~~
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:369:5: note: ‘std::uintptr_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
  369 |     std::uintptr_t _base_address;
      |     ^~~
/home/stephan/Projects/peary/peary/utils/datatypes.hpp: In member function ‘bool caribou::memory_map::operator<(const caribou::memory_map&) const’:
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:359:10: error: ‘_base_address’ was not declared in this scope
  359 |       if(_base_address == other.getBaseAddress()) {
      |          ^~~~~~~~~~~~~
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:359:33: error: ‘const class caribou::memory_map’ has no member named ‘getBaseAddress’
  359 |       if(_base_address == other.getBaseAddress()) {
      |                                 ^~~~~~~~~~~~~~
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:365:14: error: ‘_base_address’ was not declared in this scope
  365 |       return _base_address < other.getBaseAddress();
      |              ^~~~~~~~~~~~~
/home/stephan/Projects/peary/peary/utils/datatypes.hpp:365:36: error: ‘const class caribou::memory_map’ has no member named ‘getBaseAddress’
  365 |       return _base_address < other.getBaseAddress();
      |                                    ^~~~~~~~~~~~~~

Merge request reports