Following this post (https://stackoverflow.com/questions/54350343/findnext64-crashed-with-access-violation) which looks like my problem described in https://forums.codeblocks.org/index.php/topic,24363.msg166172.html#msg166172, and the recommendation on https://docs.microsoft.com/en-us/windows-hardware/drivers/kernel/64-bit-compiler, saying that the macro _M_IA64 should be avoided, I have replaced in src\plugins\compilergcc\depslib\src\filent.c the 64 bits test, at line 70, # ifdef _M_IA64 by # ifdef _WIN64 //_M_IA64. Until now, this didn't cause crash in C::B, but with very recent MinGW64 versions (02/2021), it's apparently a problem, at least on my PC.
With this patch, my compiled C::B works again, as it should, when using the "build" icon.
Here is a new version ot this patch. It deletes the usage of FINDTYPE and replace it by intptr_t: the correct length for the handle pointer is set by the compiler itself and not by an internal filent test.
More, I have also corrected a warning in a sprintf.
Last edit: Gerard DURAND 2021-03-30
This seems correct. Testing currently for side-effects. Also, we need to check when intptr_t was introduced into the compiler chains such that we don't cause compiler errors for older compilers (still quite often the used)...
Thanks. May be the first version with _WIN64 is sufficient (though less elegant !)
May be something like: if defined(_M_IA64) || defined(_WIN64) works in any case !
intptr_t is better IMO. You have to include stdint.h to make it more likely that it won't break in the future. Som older MSVCs don't have it, but we mostly care for GCC/clang compilers. Also this type is marked optional, which is annoying.
See here for details: https://en.cppreference.com/w/c/types/integer
Any idea when the updated patch or one of the existing patches will be applied so devs using MSYS2 can built from SVN again without using a locally hacked / modified version of filent.c ?
BTW This currently the only change needed to successfully build Cb from MSYS2mingw64 from to SVN sources.
@ mortenmacfly Any update as this is the last change that is stopping building CB with MSYS2?
How about applying the attached patch until Morten completes his work. This was people do not have to have a locally modified file that they have to remember not to include in a path or push etc?
This is a quick and simple change where I have used a bunch of defines that is already used in CB somewhere to ensure that it should hopefully work on all of the compilers that people use to build CB with.
Sorry hit the wrong button. Attachment is not attached.
Personally, I would prefer to continue to use intptr_t. The compatibility with other compilers than mingw is not really a problem for C::B because intptr_t is already used at least in 8 .c, .cpp or .h files in C::B code.
I just want to be able to build CB from source without a local file being patched and this has been going for 3 months now. About time a patch is applied as a stop gap measure until Morten completes his work.