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

include/curl/mprintf.h: add __attribute__ for the prototypes #11589

Closed
wants to merge 3 commits into from

Conversation

bagder
Copy link
Member

@bagder bagder commented Aug 4, 2023

  • if gcc or clang is used
  • if __STDC_VERSION__ >= 199901L, which means greater than C90
  • if not using mingw
  • only if CURL_NO_FMT_CHECKS is not defined

@bagder
Copy link
Member Author

bagder commented Aug 4, 2023

  1. It might be a little "dangerous" to add this in the public header and thus impose this on "everyone"
  2. the infof() and failf() format checks we have are disabled on mingw32. Do we need that here as well?

@bagder bagder force-pushed the bagder/printf-attributes branch from 4723f3b to 7b269a6 Compare August 4, 2023 09:15
@github-actions github-actions bot added the tests label Aug 4, 2023
@bagder bagder force-pushed the bagder/printf-attributes branch from 6a18568 to 5655fcd Compare August 6, 2023 20:15
@bagder bagder marked this pull request as ready for review August 6, 2023 20:16
@bagder
Copy link
Member Author

bagder commented Aug 6, 2023

2: yes, mingw will warn on use of the 'z' flag and we can't have that

bagder added 3 commits August 6, 2023 22:28
- if gcc or clang is used
- if __STDC_VERSION__ >= 199901L, which means greater than C90
- if not using mingw
- if CURL_NO_FMT_CHECKS is not defined
@bagder bagder force-pushed the bagder/printf-attributes branch from 5655fcd to 6d42c0f Compare August 6, 2023 20:30
@bagder
Copy link
Member Author

bagder commented Aug 7, 2023

I'll take my chances and merge this. If it backfires, we can maybe make the mprintf.h defines only apply when building libcurl.

@bagder bagder closed this in cfe85ca Aug 7, 2023
@bagder bagder deleted the bagder/printf-attributes branch August 9, 2023 08:06
ptitSeb pushed a commit to wasix-org/curl that referenced this pull request Sep 25, 2023
- if gcc or clang is used
- if __STDC_VERSION__ >= 199901L, which means greater than C90
- if not using mingw
- if CURL_NO_FMT_CHECKS is not defined

Closes curl#11589
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

1 participant