Menu

#409 WIN32: MSVC: fix warnings on dynamic load.

v3.x
closed-accepted
gpz
None
enhancement
2025-11-30
2025-11-29
No

I update the patch with support for UNICODE charset posted into r45864 because:

  • MSVC complains that malloc() and free() have no prototype.
  • GCC15 doesn't like the const modifier applied to alloc_wchar_from_char().

Attached patch includes these tiny fixes.

1 Attachments

Discussion

  • gpz

    gpz - 2025-11-29

    i have missed that before - instead of malloc/free use lib_malloc and lib_free please (and then you shouldnt have to include stdlib)

     
  • Carlo Bramini

    Carlo Bramini - 2025-11-29

    lib_malloc() and lib_free() are also undefined.
    So, I guess that I have to include also "lib.h" for using them.
    BTW, since this is a Windows-only source, would you like to use HeapAlloc()/HeapFree() from WinAPI (so, without any extra include file) or you still prefer lib_malloc() and lib_free()?
    Nothing changes to me, just let me know which one you prefer.

     
  • gpz

    gpz - 2025-11-29

    lib_ functions should be used for everything regarding memory allocation - that allows the debug mode to track memory usage (and find some leaks)

     
  • Carlo Bramini

    Carlo Bramini - 2025-11-30

    Thanks, I attached a new patch with your suggestions.

     
  • gpz

    gpz - 2025-11-30

    applied in r45875, thanks!

     
  • gpz

    gpz - 2025-11-30
    • status: open --> closed-accepted
    • assigned_to: gpz
     

Log in to post a comment.

MongoDB Logo MongoDB