Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sprintf is deprecated on macOS 13 #33

Closed
aeiouaeiouaeiouaeiouaeiouaeiou opened this issue Apr 29, 2023 · 1 comment
Closed

sprintf is deprecated on macOS 13 #33

aeiouaeiouaeiouaeiouaeiouaeiou opened this issue Apr 29, 2023 · 1 comment

Comments

@aeiouaeiouaeiouaeiouaeiouaeiou
make[2]: Entering directory `/opt/local/var/macports/build/_Users_runner_work_macports-ports_macports-ports_ports_audio_audiowmark/audiowmark/work/audiowmark-0.6.1/src'
    CXX      audiowmark.o
    CXX      utils.o
    CXX      random.o
    CXX      convcode.o
  utils.cc:117:7: warning: '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. [-Wdeprecated-declarations]
        sprintf (buffer, "%02x", byte);
        ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/stdio.h:188:1: note: 'sprintf' has been explicitly marked deprecated here
  __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.")
  ^
  /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/usr/include/sys/cdefs.h:215:48: note: expanded from macro '__deprecated_msg'
          #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
                                                        ^
  1 warning generated.

This is an uncritical but strange decision to force snprintf().

@swesterfeld
Copy link
Owner

Ok, the current code is not really broken, but on the other hand, we have already a "safe" version of sprintf called string_printf, which doesn't require guessing an upper bound, so I'll change the code to just use this.

swesterfeld added a commit that referenced this issue Apr 30, 2023
* avoid-sprintf:
  Replace sprintf with string_printf.
	Fixes #33.
  SyncFinder: update debug code to current watermark length / offset

Signed-off-by: Stefan Westerfeld <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants