diff --git a/src/coap_notls.c b/src/coap_notls.c index 621ab0f4..64dd9f04 100644 --- a/src/coap_notls.c +++ b/src/coap_notls.c @@ -165,8 +165,13 @@ ssize_t coap_tls_read(coap_session_t *session UNUSED, #else /* !HAVE_LIBTINYDTLS && !HAVE_OPENSSL */ -/* make compilers happy that do not like empty modules */ +/* Make compilers happy that do not like empty modules. As this + * function is never used, we ignore -Wunused-function temporarily. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" static inline void dummy(void) { } +#pragma GCC diagnostic pop #endif /* !HAVE_LIBTINYDTLS && !HAVE_OPENSSL */ diff --git a/src/coap_openssl.c b/src/coap_openssl.c index 58db28f3..2a20ecdb 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -1174,8 +1174,13 @@ ssize_t coap_tls_read(coap_session_t *session, #else /* !HAVE_OPENSSL */ -/* make compilers happy that do not like empty modules */ +/* Make compilers happy that do not like empty modules. As this + * function is never used, we ignore -Wunused-function temporarily. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" static inline void dummy(void) { } +#pragma GCC diagnostic pop #endif /* HAVE_OPENSSL */ diff --git a/src/coap_tinydtls.c b/src/coap_tinydtls.c index f718c0a4..3a5e6493 100644 --- a/src/coap_tinydtls.c +++ b/src/coap_tinydtls.c @@ -503,8 +503,13 @@ ssize_t coap_tls_read(coap_session_t *session UNUSED, #else /* !HAVE_LIBTINYDTLS */ - /* make compilers happy that do not like empty modules */ +/* Make compilers happy that do not like empty modules. As this + * function is never used, we ignore -Wunused-function temporarily. + */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-function" static inline void dummy(void) { } +#pragma GCC diagnostic pop #endif /* HAVE_LIBTINYDTLS */