sprintf deprecated

Open
#107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
50/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Review the sprintf calls in libs/format/benchmark/bench_format.cpp, including the surrounding buffer and format-string usage. Check the benchmark behavior on macOS Clang and confirm that the deprecated calls are addressed without changing the measured formatting results; the benchmark should build without sprintf deprecation warnings.

Written by the indexing model from the issue text.

Description

sprintf is deprecated on macos clang.

"Use snprintf if available as some compilers (clang 14.0) issue deprecation warnings for sprintf"

sprintf appears in these files:

libs/format/benchmark/bench_format.cpp:// bench_variants.cc :  do the same task, with sprintf, stream, and format
libs/format/benchmark/bench_format.cpp:    // Check that sprintf is Unix98 compatible on the platform :
libs/format/benchmark/bench_format.cpp://      (e.g., it expects sprintf to be POSIX compliant)
libs/format/benchmark/bench_format.cpp:#include <cstdio>  // sprintf
libs/format/benchmark/bench_format.cpp:      sprintf(buf, fstring.c_str(), arg1, arg2, arg3);
libs/format/benchmark/bench_format.cpp:    sprintf(buf, fstring.c_str(), arg1, arg2, arg3);
Dominant language
C++
Stars
31
Forks
53
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from boostorg/format

All issues in boostorg/format

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.