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

Don't use sprintf #731

Closed
bangerth opened this issue Jun 1, 2024 · 2 comments
Closed

Don't use sprintf #731

bangerth opened this issue Jun 1, 2024 · 2 comments

Comments

@bangerth
Copy link
Contributor

bangerth commented Jun 1, 2024

The ASPECT logs show these warnings:

/Users/jenkins/jenkins/workspace/aspect-osx_PR-5715/contrib/world_builder/include/doctest/doctest.h:4158:3: 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]
  DOCTEST_TO_STRING_OVERLOAD(char, "%d")
  ^
/Users/jenkins/jenkins/workspace/aspect-osx_PR-5715/contrib/world_builder/include/doctest/doctest.h:4154:10: note: expanded from macro 'DOCTEST_TO_STRING_OVERLOAD'
    std::sprintf(buf, fmt, in);                                                                \
         ^
/Library/Developer/CommandLineTools/SDKs/MacOSX13.1.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.")
^

I don't know whether doctest is under your control, but it's probably worth addressing these warnings.

@MFraters
Copy link
Member

MFraters commented Jun 4, 2024

Thanks for reporting. Yes, this can be changed in the world builder, and then be upstreamed if needed. I will take a look at this.

@MFraters
Copy link
Member

MFraters commented Jun 6, 2024

I noticed this has already been resolved in #704. I am making a backport to ASPECT.

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