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

Warnings on building Testbed from uses of *sprintf #442

Closed
louis-langholtz opened this issue Feb 7, 2023 · 0 comments · Fixed by #443
Closed

Warnings on building Testbed from uses of *sprintf #442

louis-langholtz opened this issue Feb 7, 2023 · 0 comments · Fixed by #443
Assignees
Labels
Enhancement For suggestions or changes that enhance any part of the project and isn't a bug. Testbed Signifies that issue or change is specific to the Testbed application.
Milestone

Comments

@louis-langholtz
Copy link
Owner

Expected/Desired Behavior or Experience:

Testbed isn't using *sprintf functions having security concerns over their design.

Actual Behavior:

Testbed is using various *sprintf functions. Some compilers, like clang and gcc, issue warnings like the following about this:

PlayRho/Testbed/Framework/Test.cpp: In member function 'void testbed::Test::Step(const testbed::Settings&, testbed::Drawer&, UiState&)':
PlayRho/Testbed/Framework/Test.cpp:1274:21: warning: 'int sprintf(char*, const char*, ...)' 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]
 1274 |         std::sprintf(buffer, "Max of %u", m_stats.m_maxTouching);
      |         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Steps to Reproduce the Actual Behavior:

git clone --recurse-submodules https://github.com/louis-langholtz/PlayRho.git
mkdir PlayRho-build
cd PlayRho-build
cmake -DPLAYRHO_BUILD_TESTBED=ON ../PlayRho
make
@louis-langholtz louis-langholtz added Enhancement For suggestions or changes that enhance any part of the project and isn't a bug. Testbed Signifies that issue or change is specific to the Testbed application. labels Feb 7, 2023
@louis-langholtz louis-langholtz added this to the 2.0 Release milestone Feb 7, 2023
@louis-langholtz louis-langholtz self-assigned this Feb 7, 2023
@louis-langholtz louis-langholtz linked a pull request Feb 7, 2023 that will close this issue
louis-langholtz added a commit that referenced this issue Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement For suggestions or changes that enhance any part of the project and isn't a bug. Testbed Signifies that issue or change is specific to the Testbed application.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant