Skip to content

Conversation

@duckdoom5
Copy link

@duckdoom5 duckdoom5 commented Sep 12, 2025

MSVC seems to define sprintf_s under __STDC_WANT_SECURE_LIB__.
image
C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stdio.h

__STDC_LIB_EXT1__ is undefined, causing the compiler to spit out this error:

stb_image_write.h(763,15): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

MSVC seems to define `sprintf_s` under `__STDC_WANT_SECURE_LIB__`. `__STDC_LIB_EXT1__` is undefined, causing the compiler to spit out this error:

```stb_image_write.h(763,15): error C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.```
@nothings
Copy link
Owner

nothings commented Sep 12, 2025

For reference, see also #1512 which I haven't figured out what to do with because I'm doubtful of the snprintf change. (I am not saying yours is a duplicate, don't close this. I just want to reference it for later.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants