Skip to content

Commit

Permalink
Fix: Ensure Command Line Arguments Are Respected in Clang Compilation
Browse files Browse the repository at this point in the history
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."
  • Loading branch information
AndreasLokko authored and krzysztof-jusiak committed Mar 14, 2024
1 parent b6c6718 commit 3cfd993
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/boost/ut.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3cfd993

Please sign in to comment.