- it'll be a can of worms you'll have to open all over again!
- I wonder, are these functions really anymore secure than their Posix counterparts?
All I added was code to suppress the one type of warning #pragma warning(disable : 4996): Are there any other further ranging effects to doing this?
the fopen_s wasn't the problem but only the wrong interpretation of the return value Fine, but this doesn't change the fact the changes are unnecessary!
BTW: I am not "attacking" MS, I am just stating there is no real good reason for these functions!
The DLL in question is just a small, couple 100 line program which I need to invoke Windows system calls (print, file I/O) from a PLC controller (Programmable Logic Computer, used in the automation industry). --Charly dleehanson: - Based upon your rational, it is my opinion that these changes are unnecessary. If I was cynical I might think the idea is to 'scare' you into changing/writing the code to use their [Microsoft] functions just to tie you in to their compiler and hence their platform. You can disable the warnings very simply by defining the following macro Actually, you got some funny advice here.
Providing Posix compliant functions are used correctly, they are just as safe as Microsoft's "secure" versions. At the one hand you should not change old code (though it is only a change from == to !
As NULL is most often #defined as 0 surely your code shows that the function fails if it actually works!? If you ever need to port this code it'll be a can of worms you'll have to open all over again!