Is there a way to use fopen_s() with GCC or at least create a #define about it?
Microsoft’s *_s functions are unportable, I usually use equivalent C89/C99 functions and disable deprecation warnings (#define _CRT_SECURE_NO_DEPRECATE). If you insist, you can use an adaptor function (not necessarily a macro!) that delegates fopen() on platforms that don’t have fopen_s(), but you must be careful to map values of errno_t return code from errno. errno_t fopen_s(FILE … Read more