Closed Foadsf closed 3 months ago
I can confirm this issue when using the compilers from MSYS2.
I'm not sure if this is MinGW-specific though. Maybe, this would also fail for GCC 14 or LLVM 18 on other platforms. These versions of the compilers are stricter when it comes to implicitly declaring functions (without prior explicit declaration).
Note that intptr_t
and uinptr_t
was added for C99. It isn't guaranteed to be available in ANSI C. Currently, the build rules don't explicitly require a minimum version of the C standard.
But most C compilers should default to C99 or a later standard by now. (GCC 14 defaults to C17 for example.)
Should a minimum version of the C standard be required in the CMake build rules? Should an exact version be enforced?
Guess, this issue then also can be closed with respect to recent code updates
Description
I encountered build errors while compiling ElmerFEM on Windows using MSYS2 MinGW. The errors are related to the
gettimeofday
function and redefinition ofalloca
.Steps to Reproduce
Error Messages
Suggested Fixes
Fix
gettimeofday
Issue: Modify the source code to usemingw_gettimeofday
when compiling on Windows. Add the following conditional compilation block intimers.c
:Fix
alloca
Redefinition: Ensurealloca
is only defined if it hasn't been defined already. Modifygkregex.c
:Fix Casting Warnings: Use
intptr_t
oruintptr_t
for casting between pointers and integers. Modifygkregex.c
:Environment
99abe68ee8d51feb07ec3f50a5026494e33c7992