Skip to content

CDRIVER-5844 fix macOS format specifier #1819

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

Merged
merged 3 commits into from
Jan 3, 2025

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Jan 2, 2025

Fixes a build error observed after upgrading from macOS 12 to macOS 13.7.2:

mongoc-secure-transport.c:335:81: error: format specifies type 'int' but the argument has type 'SecExternalItemType' (aka 'unsigned int') [-Werror,-Wformat]
  335 |       MONGOC_ERROR ("Cannot work with keys of type \"%d\". Please file a JIRA", type);
      |                                                      ~~                         ^~~~
      |                                                      %u

SecExternalItemType is represented as uint32_t. I expect the error is triggered by a local upgrade to clang.

Added improvements:

  • A string representation of the enum value is added to the error.
  • "Please file a JIRA" is replaced with "Type is not supported" for consistency (it was the only error message referencing JIRA).

Verified with this patch build.

@kevinAlbs kevinAlbs changed the title fix macos format CDRIVER-5844 fix macOS format specifier Jan 2, 2025
@kevinAlbs kevinAlbs marked this pull request as ready for review January 2, 2025 21:29
@kevinAlbs kevinAlbs requested a review from eramongodb January 2, 2025 21:29
@kevinAlbs kevinAlbs merged commit a0ce8e9 into mongodb:master Jan 3, 2025
45 checks passed
kevinAlbs added a commit that referenced this pull request Jan 3, 2025
* use `PRIu32` to match type of `SecExternalItemType`

* include string representation

* replace "Please file a JIRA" with "Type is not supported"
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

Successfully merging this pull request may close these issues.

2 participants