diff --git a/src/coap_notls.c b/src/coap_notls.c index 64dd9f04..0a0014b9 100644 --- a/src/coap_notls.c +++ b/src/coap_notls.c @@ -165,13 +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. As this - * function is never used, we ignore -Wunused-function temporarily. +#ifdef __clang__ +/* Make compilers happy that do not like empty modules. As this function is + * never used, we ignore -Wunused-function at the end of compiling this file */ -#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" +#endif 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 2a20ecdb..d8627aac 100644 --- a/src/coap_openssl.c +++ b/src/coap_openssl.c @@ -1174,13 +1174,13 @@ ssize_t coap_tls_read(coap_session_t *session, #else /* !HAVE_OPENSSL */ -/* Make compilers happy that do not like empty modules. As this - * function is never used, we ignore -Wunused-function temporarily. +#ifdef __clang__ +/* Make compilers happy that do not like empty modules. As this function is + * never used, we ignore -Wunused-function at the end of compiling this file */ -#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" +#endif 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 3a5e6493..51dae33a 100644 --- a/src/coap_tinydtls.c +++ b/src/coap_tinydtls.c @@ -503,13 +503,13 @@ ssize_t coap_tls_read(coap_session_t *session UNUSED, #else /* !HAVE_LIBTINYDTLS */ -/* Make compilers happy that do not like empty modules. As this - * function is never used, we ignore -Wunused-function temporarily. +#ifdef __clang__ +/* Make compilers happy that do not like empty modules. As this function is + * never used, we ignore -Wunused-function at the end of compiling this file */ -#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-function" +#endif static inline void dummy(void) { } -#pragma GCC diagnostic pop #endif /* HAVE_LIBTINYDTLS */