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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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).
Since you asked for C99 compliance: MSVC is complinat to C11 and C17, but there is no plan to support variable length arrays, used in this newly added code, due to security concerns (see https://devblogs.microsoft.com/cppblog/c11-and-c17-standard-support-arriving-in-msvc/#variable-length-arrays).
Last edit: Alexander Täschner 2023-07-28
Fixed by 6af1bda4 (Ethan Merritt) - thanks!