aceckel
aceckel
@FrancescAlted Could you please provide a minimal code example exhibiting the problem, along with the compile and link commands used to build?
@mikedld In light of this discussion on compiler flags, perhaps we should replace the Makefile in this repo with a CMakeLists.txt that has special handling for the MSVC case?
@mikedld So I think the issue with incremental linking is that the linker inserts zero-padding around definitions, so we cannot rely on `struct ctest` objects being contiguous in the `.ctest`...
That might look something like this (also untested): ``` #define CTEST_IMPL_CTOR_FNAME(sname, tname) CTEST_IMPL_NAME(sname##_##tname##_ctor) #define CTEST_IMPL_CTOR_FPNAME(sname, tname) CTEST_IMPL_NAME(sname##_##tname##_ctor_ptr) ... #define CTEST_IMPL_CTEST(sname, tname, tskip) \ static void CTEST_IMPL_FNAME(sname, tname)(void); \ CTEST_IMPL_STRUCT(sname, tname,...
@mikedld I've confirmed that the above approach works correctly on MSVC 2017 with @FrancescAlted's original configuration. Additionally, I tried it with several combinations of optimization flags (including link-time optimization) and...
> [...] I'm a bit worried [...] that we'll have to support two mechanisms for test cases discovery... I know that at least GCC and Clang have support for similar...