From 4a39f2cfcf4260b97436cef6bb7e731989403607 Mon Sep 17 00:00:00 2001 From: leonarski_f Date: Sat, 20 Jun 2026 07:15:47 +0200 Subject: [PATCH] Fix FFTW build-tree header wiring and two MSVC warnings FFTW exposes fftw3.h only via $, so consuming fftw3f from the build tree (FetchContent) leaves FFTIndexerCPU.h unable to find the header. A system-installed fftw3.h masks this on Linux, so it only bit on Windows; add the source-tree api/ dir to fftw3f's interface includes. Also two viewer-reachable warnings: - time_utc.h (C4477): %03ld was fed a chrono milliseconds::rep (64-bit), not a long; cast the 0-999 value to int and use %03d. - HDF5Objects.h (C4700): value-initialize the scalar read buffer. Co-Authored-By: Claude Opus 4.8 --- CMakeLists.txt | 4 ++++ common/time_utc.h | 2 +- writer/HDF5Objects.h | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4e68e465..92702d72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -207,6 +207,10 @@ FetchContent_Declare(fftw URL_HASH SHA256=56c932549852cddcfafdab3820b0200c7742675be92179e59e6215b340e26467 EXCLUDE_FROM_ALL) FetchContent_MakeAvailable(fftw) +# FFTW exposes fftw3.h only via $, so consuming fftw3f straight from +# the build tree (FetchContent) leaves the header unreachable. On Linux a system-installed +# fftw3.h masks this; on Windows it does not. Add the source-tree api/ dir for build-tree use. +TARGET_INCLUDE_DIRECTORIES(fftw3f INTERFACE $) ADD_COMPILE_DEFINITIONS(JFJOCH_USE_FFTW) IF (JFJOCH_VIEWER_ONLY) diff --git a/common/time_utc.h b/common/time_utc.h index 4a1067ab..bec55fd7 100644 --- a/common/time_utc.h +++ b/common/time_utc.h @@ -27,7 +27,7 @@ inline std::string time_UTC(const std::chrono::time_point(time_ms % 1000)); return std::string(buf1) + std::string(buf2) + "Z"; } diff --git a/writer/HDF5Objects.h b/writer/HDF5Objects.h index d4945359..ba085b45 100644 --- a/writer/HDF5Objects.h +++ b/writer/HDF5Objects.h @@ -264,7 +264,7 @@ public: if (file_space.GetNumOfDimensions() != 0) throw JFJochException(JFJochExceptionCategory::HDF5, "Dataset tries to read scalar from vector dataset");; - T output; + T output{}; if (H5Dread(id, HDF5DataType(output).GetID(), mem_space.GetID(), H5S_ALL, H5P_DEFAULT, &output) < 0) throw JFJochException(JFJochExceptionCategory::HDF5, dataset_name + ": read unsuccessful"); return output;