From 3cfd9937e1d4c9375f7d7904a5ba6a1926f7161f Mon Sep 17 00:00:00 2001 From: Andreas Lokko Date: Thu, 14 Mar 2024 11:03:34 +0200 Subject: [PATCH] Fix: Ensure Command Line Arguments Are Respected in Clang Compilation Resolved an issue where command line arguments were ignored, specifically when the program was compiled with Clang. The problem was addressed by correctly assigning the priority in __attribute__((constructor(101))), ensuring proper initialization and consistent behavior across compilation environments." --- include/boost/ut.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boost/ut.hpp b/include/boost/ut.hpp index 941dffcb..b0e59ed9 100644 --- a/include/boost/ut.hpp +++ b/include/boost/ut.hpp @@ -3312,7 +3312,7 @@ using operators::operator>>; #if (defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER)) && \ !defined(__EMSCRIPTEN__) -__attribute__((constructor)) inline void cmd_line_args(int argc, +__attribute__((constructor(101))) inline void cmd_line_args(int argc, const char* argv[]) { ::boost::ut::detail::cfg::largc = argc; ::boost::ut::detail::cfg::largv = argv;