Skip to content

core: add build patch for sprintf in macos builds#1636

Merged
BareosBot merged 4 commits intobareos:masterfrom
chenrui333:patch-macos-build
Jan 8, 2024
Merged

core: add build patch for sprintf in macos builds#1636
BareosBot merged 4 commits intobareos:masterfrom
chenrui333:patch-macos-build

Conversation

@chenrui333
Copy link
Contributor

@chenrui333 chenrui333 commented Dec 17, 2023

This pr fixes the following build issue on macos

/tmp/bareos-client-20231217-15168-qlx505/bareos-Release-23.0.0/core/src/tests/job_control_record.cc:62:5: 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]
    sprintf(jobs[i]->Job, "%d-test", 123 + i);
    ^
/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)))
                                                      ^
/tmp/bareos-client-20231217-15168-qlx505/bareos-Release-23.0.0/core/src/tests/job_control_record.cc:121:3: 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]
  sprintf(jcr->Job, "987-654-321");
  ^
/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)))
                                                      ^

Thank you for contributing to the Bareos Project!

Please check

  • Short description and the purpose of this PR is present above this paragraph
  • Your name is present in the AUTHORS file (optional)

If you have any questions or problems, please give a comment in the PR.

Helpful documentation and best practices

Checklist for the reviewer of the PR (will be processed by the Bareos team)

Make sure you check/merge the PR using devtools/pr-tool to have some simple automated checks run and a proper changelog record added.

General
  • Is the PR title usable as CHANGELOG entry?
  • Purpose of the PR is understood
  • Commit descriptions are understandable and well formatted
    Check backport line
  • Required backport PRs have been created
Source code quality
  • Source code changes are understandable
  • Variable and function names are meaningful
  • Code comments are correct (logically and spelling)
  • Required documentation changes are present and part of the PR

relates to Homebrew/homebrew-core#157558

@sduehr sduehr requested a review from sebsura December 21, 2023 11:30
@sduehr sduehr changed the title chore: add build patch for sprintf in macos builds core: add build patch for sprintf in macos builds Dec 21, 2023
Copy link
Contributor

@sebsura sebsura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution. The changes are great. Please add yourself to the AUTHORS file, so we that this can be merged.

@sebsura
Copy link
Contributor

sebsura commented Dec 21, 2023

✗  Commit checks failed:
  bac6e7f30 chore: add build patch for `sprintf` in macos builds: body contains line longer 72 chars
✗  bareos-check-sources --since=1bbd14cf1d9c05071559fd3a98bd2e5dd6da6e9a reported:
  Plugin 'fix copyright year' would modify 'core/src/tests/job_control_record.cc'

devtools/pr-tool also reported these problems.

@sebsura
Copy link
Contributor

sebsura commented Jan 5, 2024

I fixed the problems and added you to the authors file. If you did not want to be added, please leave a comment here!

@chenrui333
Copy link
Contributor Author

I fixed the problems and added you to the authors file. If you did not want to be added, please leave a comment here!

happy to be in the authors list, thanks!

@BareosBot BareosBot merged commit 3feab89 into bareos:master Jan 8, 2024
@chenrui333
Copy link
Contributor Author

Thanks @sebsura!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants