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

build: resolve a -Wunused-function compiler warning #308

Merged
merged 1 commit into from
Jun 11, 2024

Conversation

jengelh
Copy link
Contributor

@jengelh jengelh commented May 22, 2024

posixSocket.cpp:67:7: warning: ‘char*
{anonymous}::vmime_strerror_r_result(int, char*)’ defined but not used [-Wunused-function]
   67 | char* vmime_strerror_r_result(int /* res */, char* buf) {

It is to be expected that one of the two r_result functions is going unused, depending on whichever platform we are currently building on.

@vincent-richard
Copy link
Member

Hello! If I'm not mistaken, attribute is specific to GCC, and the standard way of doing it with [[maybe_unused]] is available in C++17 only. Maybe we could do some check at configure and use a #define depending on what we detect?

posixSocket.cpp:67:7: warning: ‘char*
{anonymous}::vmime_strerror_r_result(int, char*)’ defined but not
used [-Wunused-function]
   67 | char* vmime_strerror_r_result(int /* res */, char* buf) {

It is to be expected that one of the two r_result functions is going unused,
depending on whichever platform we are currently building on.
@jengelh
Copy link
Contributor Author

jengelh commented May 31, 2024

The [[ ]] attribute syntax is C++11, so we can use it in principle, but compiler may nag about unknown attributes so I slapped it into a __GNUC__-based define to get this over with.

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.

None yet

2 participants