SIOF (Scheme in One File) – A Minimal R7RS Scheme System
11–13 of 13 posts
Re: SIOF (Scheme in One File) – A Minimal R7RS Scheme System
#12> -D_CRT_SECURE_NO_WARNINGS for Windows headers (unless you want to hear that fopen is no longer a reasonable way to open files) Wait, is fopen deprecated? Is this just on Windows?
Any function that had a target pointer for multiple items would get an size parameter, so f.ex. memcpy and strcpy have both dest buffer size and copy count, dest buffer size being smaller than count is a failure and produces an corresponding errno.
errno handling being the explicit return value is the change for Microsoft's fopen_s , probably to avoid multithreaded errno issues (is the global a thread local despite not being initially specified or do we risk race conditions).
To Microsoft's credit it seems that the standard bodies agreed on the replacements being improvements and they are now in C11, Microsoft just decided to push this for developers on Windows, probably since insecure programs affected their image and they've since that XP-era u-turn actually done a lot to fix what was an inherently insecure OS.
https://learn.microsoft.com/en-us/cpp/c-runtime-library/refe...
https://learn.microsoft.com/en-us/cpp/c-runtime-library/refe...