modelon-community / fmi-library

C library for importing FMUs
Other
115 stars 34 forks source link

Latest version FTBS on Debian/Trixie (gcc 14) #147

Open Trophime opened 1 month ago

Trophime commented 1 month ago

Hi, I'm trying to recompile latest version 3.0a4. I run with issue with fileno in:

Now, I'm stuck with error in Minizip:

/home/feelpp/salome/SALOME-master-native-DBn/a/SOURCES/FMILibrary/ThirdParty/Minizip/minizip/zip.c:1249:28: error: assignment to ‘const long unsigned int *’ from incompatible pointer type ‘const z_crc_t *’ {aka ‘const unsigned int *’} [-Wincompatible-pointer-types]
 1249 |         zi->ci.pcrc_32_tab = get_crc_table();
      |                            ^
make[2]: *** [Config.cmake/Minizip/CMakeFiles/minizip.dir/build.make:135: Config.cmake/Minizip/CMakeFiles/minizip.dir/__/__/ThirdParty/Minizip/minizip/zip.c.o] Error 1

Could you help me with that error? Would it be possible to use a "standard" version of Minizip? Best

filip-stenstrom commented 1 month ago

I can replicate these issues on Trixie with gcc 14.

fileno: Problem seems to be that we should define #define _POSIX_C_SOURCE 200809L before including stdio.h for gcc 14, or use some appropriate -std=....

mkdir/mymkdir: Didn't look into why we need sys/stat.h, also just added it for now to make it compile.

Pointer type mismatch error: Seems also to be gcc being stricter. Type casting the right hand side makes it compile, but didn't look much into the problem. Recompiling will show some type mismatch in FMIL code as well. Also type casting there (e.g. just (void*)) makes FMIL compile and tests pass.

Using a standard version of Minizip: Unfortunately this is not yet possible. There is a flag for FMILIB_FIND_PACKAGE_ZLIB and a PR open for Expat, but nothing for Minizip yet.

filip-stenstrom commented 1 month ago

We don't expect to have a fix anytime soon, since we're still on older versions of gcc.