Menu

Git Repository Merge Request #27: Replace array by pointer allocation for MSVC (rejected)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

Alexander Täschner wants to merge 2 commits from /u/taschna/gnuplot/ to master, 2023-08-21

MSVC does not allow array allocation using const casted integers, so use pointer allocation instead.

Commit Date  
[0f4156] (FixMSVC) by Alexander Täschner Alexander Täschner

Correct size of allocation and add free.

2023-07-13 05:46:39 Tree
[8c1d4d] by Alexander Täschner Alexander Täschner

Replace array by pointer allocation

2023-07-12 07:06:43 Tree

Discussion

  • Ethan Merritt

    Ethan Merritt - 2023-07-13

    The patched code segfaults on my machine.
    I can see it needs a sizeof(coordval) in the allocation.
    Also needs a free() to avoid memory leak.

    What version of MSVC is this?  I thought MSVC 2015 was c99 compliant. If it isn't, that's probably a problem elsewhere in the code as well.

     

    Last edit: Ethan Merritt 2023-07-13
  • Alexander Täschner

    Corrected the allocation size and added the missing free().

    This is the most current MSVC compiler (2022 v 17.6.5) which errors out at this newly added code. I found no other problems elsewhwere in the code (monthly runs at https://github.com/AlexanderTaeschner/gnuplot).

     
  • Alexander Täschner

    Fixed by 6af1bda4 (Ethan Merritt) - thanks!

     
  • Alexander Täschner

    • Status: open --> rejected
     

Log in to post a comment.

MongoDB Logo MongoDB