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
I discover a few problems with the compilation of the bouncing ball FMU. It seems like strdup might not be working in all versions of gcc (at least it seems to be the thing called last on the broken strings).
The build description states that C99 must be used and I can confirm that it only works if this is present. However if compiled on Windows with (chocolatey) gcc 8.1.0 then the strings (char*) in the log callback are all invalid. But if I change the compiler to msys gcc 11.20 then they work.
Is this intended because I would have expected the CMakeLists file to check if the compiler is capable of compiling the sources correctly. If this is because of the use of strdup then it could be that one of the preconditions for using this function is not meet in gcc 8.1.0 https://en.cppreference.com/w/c/experimental/dynamic/strdup
Discovered this when compiling the FMU on github actions as part of testing another library that made ude of the FMU. Chocolatey gcc is default on github actions windows-2019 (was latest until 17 Jan 2022 and may still be until March 6)
The text was updated successfully, but these errors were encountered:
I think the more likely culprit than C99 or gcc version issues is the fact that for _WIN32 the reference FMUs use _strdup and multi-byte aware functions rather than strdup. It is likely that this works reliably only on mingw-gcc (in addition to MSVC), and not on non-mingw gcc. Maybe making conditionalization on _WIN32 be more MSVC-specific might be helpful.
Just my two cents...
t-sommer
added a commit
to t-sommer/Reference-FMUs
that referenced
this issue
Feb 23, 2022
I discover a few problems with the compilation of the bouncing ball FMU. It seems like
strdup
might not be working in all versions of gcc (at least it seems to be the thing called last on the broken strings).The build description states that
C99
must be used and I can confirm that it only works if this is present. However if compiled on Windows with (chocolatey) gcc 8.1.0 then the strings (char*
) in the log callback are all invalid. But if I change the compiler to msys gcc 11.20 then they work.Is this intended because I would have expected the CMakeLists file to check if the compiler is capable of compiling the sources correctly. If this is because of the use of
strdup
then it could be that one of the preconditions for using this function is not meet in gcc 8.1.0 https://en.cppreference.com/w/c/experimental/dynamic/strdupDiscovered this when compiling the FMU on github actions as part of testing another library that made ude of the FMU. Chocolatey gcc is default on github actions windows-2019 (was latest until 17 Jan 2022 and may still be until March 6)
The text was updated successfully, but these errors were encountered: