idris-lang / Idris2

A purely functional programming language with first class types
https://idris-lang.org/
Other
2.53k stars 380 forks source link

[ fix ] fix windows CI, aligned_alloc not supported on win32 #3283

Closed dunhamsteve closed 6 months ago

dunhamsteve commented 6 months ago

Description

The support code calls aligned_alloc which does not appear to be supported on windows, and is not defined in the stdlib.h header file. The latest GitHub windows image has turned the warning about this into an error, causing ci to fail.

I’ve updated the condition in memoryManagement.c to use the fallback branch which calls malloc when building on windows.

dunhamsteve commented 6 months ago

Additional details:

It looks like we've been getting warnings about aligned_alloc being implicitly defined for a while, but the latest github windows image contains a newer version of GCC that escalates this to an error. I also found cppreference.com which says that "This function is not supported in Microsoft C Runtime library".

It looks like, despite not being defined in the header files, the linker was finding this function. But I presume malloc is fine here, since it is declared and is already being used on some systems.

andrevidela commented 6 months ago

Astounding work, thank you