diff options
author | Jan Engelhardt <[email protected]> | 2024-06-11 18:44:18 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-06-11 18:44:18 +0000 |
commit | 5f8fa2260278618b164272e9d9ee15b39704b30e (patch) | |
tree | d2fd5b2ce20d4b32a499c0f3dde2951ce166cac2 | |
parent | asciiPercent computation: another potential multiplication overflow (#307) (diff) | |
download | vmime-5f8fa2260278618b164272e9d9ee15b39704b30e.tar.gz vmime-5f8fa2260278618b164272e9d9ee15b39704b30e.zip |
build: resolve a -Wunused-function compiler warning (#308)
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.
-rw-r--r-- | src/vmime/platforms/posix/posixSocket.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/vmime/platforms/posix/posixSocket.cpp b/src/vmime/platforms/posix/posixSocket.cpp index aec6a83e..c0ce0cfa 100644 --- a/src/vmime/platforms/posix/posixSocket.cpp +++ b/src/vmime/platforms/posix/posixSocket.cpp @@ -64,14 +64,20 @@ namespace { -char* vmime_strerror_r_result(int /* res */, char* buf) { +#ifdef __GNUC__ +# define GNU_UNUSED [[gnu::unused]] +#else +# define GNU_UNUSED +#endif + +GNU_UNUSED char* vmime_strerror_r_result(int /* res */, char* buf) { // XSI-compliant prototype: // int strerror_r(int errnum, char *buf, size_t buflen); return buf; } -char* vmime_strerror_r_result(char* res, char* /* buf */) { +GNU_UNUSED char* vmime_strerror_r_result(char* res, char* /* buf */) { // GNU-specific prototype: // char *strerror_r(int errnum, char *buf, size_t buflen); |