You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do something about the windows compilation warning: C++ designated initializers only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions] #63
* checking whether package 'RcppTskit' can be installed ... WARNING
Found the following significant warnings:
../inst/include/tskit/tskit/core.h:171:21: warning: C++ designated initializers only available with '-std=c++20' or '-std=gnu++20' [-Wc++20-extensions]
The code causing this is
/*
We define a specific NAN value for default mutation time which indicates
the time is unknown. We use a specific value so that if mutation time is set to
a NAN from a computation we can reject it. This specific value is a non-signalling
NAN with the last six fraction bytes set to the ascii of "tskit!"
*/
#define TSK_UNKNOWN_TIME_HEX 0x7FF874736B697421ULL
static inline double
__tsk_nan_f(void)
{
const union {
uint64_t i;
double f;
} nan_union = { .i = TSK_UNKNOWN_TIME_HEX };
return nan_union.f;
}
The .i = is throwing the error, but only on CRAN Windows (not on GitHub windows or R Universe windows) and chat with tskit-devs suggests this is CRAN windows toolset issue tskit-dev/tskit#3375.
Removing the above mentioned .i = and the win-builder compiles without a WARNING, however this would require upstream change of valid C code :(
Adding CXX_STD = CXX20 to Makevars and the win-builder compiles without a WARNING, so I think I will go with this option at this stage to get over this hurdle and evaluate downstream if this limits distribution of RcppTskit due to specifying C++ 2020 standard (which seems to become broadly used 2021-2023, so some older systems might complain!?)
A third alternative, that I did not check, seems to be to ignore warnings from tskit/core.h using the following in our shim core.h - not sure if I like or dislike this option ... but is one option if specifying C++ 2020 standard is too limiting.
Activity
gregorgorjanc commentedon Feb 9, 2026
I tried submission to https://win-builder.r-project.org with:
Removing the above mentioned
.i =and the win-builder compiles without a WARNING, however this would require upstream change of valid C code :(Adding
CXX_STD = CXX20toMakevarsand the win-builder compiles without a WARNING, so I think I will go with this option at this stage to get over this hurdle and evaluate downstream if this limits distribution ofRcppTskitdue to specifying C++ 2020 standard (which seems to become broadly used 2021-2023, so some older systems might complain!?)A third alternative, that I did not check, seems to be to ignore warnings from
tskit/core.husing the following in our shimcore.h- not sure if I like or dislike this option ... but is one option if specifying C++ 2020 standard is too limiting.Setting C++20 as standard to fix CRAN windows issue
gregorgorjanc commentedon Feb 9, 2026
Done in #64