From 8684506269d29f129a28702a519467af8524ecb4 Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Tue, 7 Jul 2026 15:58:19 +0100 Subject: [PATCH] This fixes compile isuees found with GCC 16.1.1 and FMT version (#4000) Co-authored-by: Paul Romano --- include/openmc/error.h | 4 ++-- src/distribution_spatial.cpp | 8 +++++--- src/weight_windows.cpp | 3 ++- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/include/openmc/error.h b/include/openmc/error.h index d73795aee..1f6e15f49 100644 --- a/include/openmc/error.h +++ b/include/openmc/error.h @@ -64,14 +64,14 @@ void write_message( int level, const std::string& message, const Params&... fmt_args) { if (settings::verbosity >= level) { - write_message(fmt::format(message, fmt_args...)); + write_message(fmt::format(fmt::runtime(message), fmt_args...)); } } template void write_message(const std::string& message, const Params&... fmt_args) { - write_message(fmt::format(message, fmt_args...)); + write_message(fmt::format(fmt::runtime(message), fmt_args...)); } #ifdef OPENMC_MPI diff --git a/src/distribution_spatial.cpp b/src/distribution_spatial.cpp index ba8658f10..5a3452422 100644 --- a/src/distribution_spatial.cpp +++ b/src/distribution_spatial.cpp @@ -262,9 +262,11 @@ std::pair SphericalIndependent::sample(uint64_t* seed) const MeshSpatial::MeshSpatial(pugi::xml_node node) { - if (get_node_value(node, "type", true, true) != "mesh") { - fatal_error(fmt::format( - "Incorrect spatial type '{}' for a MeshSpatial distribution")); + auto spatial_type = get_node_value(node, "type", true, true); + if (spatial_type != "mesh") { + fatal_error( + fmt::format("Incorrect spatial type '{}' for a MeshSpatial distribution", + spatial_type)); } // No in-tet distributions implemented, could include distributions for the diff --git a/src/weight_windows.cpp b/src/weight_windows.cpp index 39e46026c..0d268ce17 100644 --- a/src/weight_windows.cpp +++ b/src/weight_windows.cpp @@ -837,7 +837,8 @@ WeightWindowsGenerator::WeightWindowsGenerator(pugi::xml_node node) ratio_)); if (ratio_ <= 1.0) fatal_error(fmt::format("Invalid weight window ratio '{}' (<= 1.0) " - "specified for weight window generation")); + "specified for weight window generation", + ratio_)); // create a matching weight windows object auto wws = WeightWindows::create();