token.cpp: use snprintf() to fix -Wdeprecated-declarations AppleClang warning#7744
Merged
chrchr-github merged 1 commit intodanmar:mainfrom Aug 16, 2025
Merged
token.cpp: use snprintf() to fix -Wdeprecated-declarations AppleClang warning#7744chrchr-github merged 1 commit intodanmar:mainfrom
snprintf() to fix -Wdeprecated-declarations AppleClang warning#7744chrchr-github merged 1 commit intodanmar:mainfrom
Conversation
Collaborator
firewave
commented
Aug 15, 2025
…lang warning
```
/Users/runner/work/cppcheck/cppcheck/lib/token.cpp:1611:21: error: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Werror,-Wdeprecated-declarations]
1611 | sprintf(str, "\\x%02x", c);
| ^
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/_stdio.h:274:1: note: 'sprintf' has been explicitly marked deprecated here
274 | __deprecated_msg("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead.")
| ^
/Applications/Xcode_16.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/include/sys/cdefs.h:218:48: note: expanded from macro '__deprecated_msg'
218 | #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
| ^
```
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


