Menu

#1086 Bug in filent.c

Undefined
applied
Patch
2021-06-29
2021-03-27
No

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.

1 Attachments

Discussion

  • Gerard DURAND

    Gerard DURAND - 2021-03-29

    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
  • Morten MacFly

    Morten MacFly - 2021-04-03
    • status: open --> pending
    • assigned_to: Morten MacFly
     
  • Morten MacFly

    Morten MacFly - 2021-04-03

    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)...

     
  • Gerard DURAND

    Gerard DURAND - 2021-04-03

    Thanks. May be the first version with _WIN64 is sufficient (though less elegant !)

     
  • Gerard DURAND

    Gerard DURAND - 2021-04-03

    May be something like: if defined(_M_IA64) || defined(_WIN64) works in any case !

     
  • Teodor Petrov

    Teodor Petrov - 2021-04-03

    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

     
  • Andrew Cottrell

    Andrew Cottrell - 2021-06-22

    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.

     
  • Andrew Cottrell

    Andrew Cottrell - 2021-06-24

    @ mortenmacfly Any update as this is the last change that is stopping building CB with MSYS2?

     
  • Andrew Cottrell

    Andrew Cottrell - 2021-06-28

    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.

     
  • Andrew Cottrell

    Andrew Cottrell - 2021-06-28

    Sorry hit the wrong button. Attachment is not attached.

     
  • Gerard DURAND

    Gerard DURAND - 2021-06-28

    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.

     
  • Andrew Cottrell

    Andrew Cottrell - 2021-06-28

    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.

     
  • Teodor Petrov

    Teodor Petrov - 2021-06-29
    • labels: --> depslib, Compiler
    • status: pending --> applied
    • assigned_to: Morten MacFly --> Teodor Petrov
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.