jkuhlmann / cgltf

:diamond_shape_with_a_dot_inside: Single-file glTF 2.0 loader and writer written in C99
MIT License
1.42k stars 135 forks source link

fopen or strcpy this function or variable is unsafe. #218

Open 1623275623 opened 1 year ago

1623275623 commented 1 year ago

屏幕截图 2023-05-30 161529 if i define _CRT_SECURE_NO_WARNINGS. the problem maybe solved. but I want know why this problem was happened. have another way to solve it.

zeux commented 1 year ago

Yeah cgltf.h needs something like

#ifndef _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#endif

in its implementation section. This won't fully help if cgltf.h is compiled as part of a .cpp file that includes other CRT headers before it, but it's probably the most reasonable solution. One alternative is to just pragma disable these warnings.