deprecated functions in io.h
io.h uses sprintf. VS2019 gives deprecated warnings as errors so the project will not build. I changed io.h to use sprintf_s which resolves the issue. I am not a github user really so I don't want to try committing this change. Thank you for this library, I am looking forward to trying it out.
Could you tell how you did that? I'm getting 3 errors when changing all sprintf to sprintf_s in io.h.
C2440 'function': cannot convert from 'float' to 'const char *const' Line 82
C2440 'function': cannot convert from 'float' to 'const char *const' Line 125
C2440 'function': cannot convert from 'float' to 'const char *const' Line 167
Hi, @offthebus, @Jesse2431
#define _CRT_SECURE_NO_WARNINGS should suppress those warnings. It is defined in cglm/common.h:
https://github.com/recp/cglm/blob/master/include/cglm/common.h#L15-L17
Do you use latest version of cglm ?
@recpt @offthebus
I'm having the same behaviour here. I have isolated it with this .c file:
test.c
#include <sys/types.h>
#include <cglm/cglm.h>
If you compile it with:
cl /c /Icglm/include test.c /MDd /W3
You 'll see the sprintf warnings.
I think the problem is this sys/types.h ends up including vcruntime.h, which is where the _CRT_INSECURE_DEPRECATE macro is defined, and your definition from common.h comes later in this case.