diff --git a/src/openvpn/ssl_mbedtls.c b/src/openvpn/ssl_mbedtls.c
index 2d29e60..19a2d48 100644
--- a/src/openvpn/ssl_mbedtls.c
+++ b/src/openvpn/ssl_mbedtls.c
@@ -199,11 +199,6 @@
         ciphers);
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
-
 void
 tls_ctx_restrict_ciphers(struct tls_root_ctx *ctx, const char *ciphers)
 {
@@ -217,7 +212,7 @@
     ASSERT(NULL != ctx);
 
     /* Get number of ciphers */
-    int cipher_count = get_num_elements(ciphers, ':');
+    size_t cipher_count = get_num_elements(ciphers, ':');
 
     /* Allocate an array for them */
     ALLOC_ARRAY_CLEAR(ctx->allowed_ciphers, int, cipher_count + 1)
@@ -339,7 +334,7 @@
     struct gc_arena gc = gc_new();
 
     /* Get number of groups and allocate an array in ctx */
-    int groups_count = get_num_elements(groups, ':');
+    size_t groups_count = get_num_elements(groups, ':');
     ALLOC_ARRAY_CLEAR(ctx->groups, uint16_t, groups_count + 1)
 
     /* Parse allowed ciphers, getting IDs */
@@ -1188,10 +1183,6 @@
     return 1;
 }
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
-
 /* **************************************
  *
  * Information functions
diff --git a/src/openvpn/ssl_openssl.c b/src/openvpn/ssl_openssl.c
index 7622d88..30ef383 100644
--- a/src/openvpn/ssl_openssl.c
+++ b/src/openvpn/ssl_openssl.c
@@ -518,11 +518,6 @@
 {
     ASSERT(ctx);
 #if OPENSSL_VERSION_NUMBER < 0x30000000L && !defined(ENABLE_CRYPTO_WOLFSSL)
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#endif
-
     struct gc_arena gc = gc_new();
     /* This method could be as easy as
      *  SSL_CTX_set1_groups_list(ctx->ctx, groups)
@@ -533,7 +528,7 @@
      * Also note that the code is wrong in the presence of OpenSSL3 providers.
      */
 
-    int groups_count = get_num_elements(groups, ':');
+    size_t groups_count = get_num_elements(groups, ':');
 
     int *glist;
     /* Allocate an array for them */
@@ -569,9 +564,6 @@
     }
     gc_free(&gc);
 
-#if defined(__GNUC__) || defined(__clang__)
-#pragma GCC diagnostic pop
-#endif
 #else  /* if OPENSSL_VERSION_NUMBER < 0x30000000L */
     if (!SSL_CTX_set1_groups_list(ctx->ctx, groups))
     {
diff --git a/src/openvpn/ssl_util.c b/src/openvpn/ssl_util.c
index 337faed..6c17fe5 100644
--- a/src/openvpn/ssl_util.c
+++ b/src/openvpn/ssl_util.c
@@ -359,14 +359,14 @@
     return NULL;
 }
 
-int
+size_t
 get_num_elements(const char *string, char delimiter)
 {
     const size_t string_len = strlen(string);
 
     ASSERT(0 != string_len);
 
-    int element_count = 1;
+    size_t element_count = 1;
     /* Get number of ciphers */
     for (size_t i = 0; i < string_len; i++)
     {
diff --git a/src/openvpn/ssl_util.h b/src/openvpn/ssl_util.h
index 6f9f65b..db5e17c 100644
--- a/src/openvpn/ssl_util.h
+++ b/src/openvpn/ssl_util.h
@@ -125,6 +125,6 @@
  * @param delimiter     the delimiter to count, typically ':'
  * @return              occrrences of delimiter + 1
  */
-int get_num_elements(const char *string, char delimiter);
+size_t get_num_elements(const char *string, char delimiter);
 
 #endif /* ifndef SSL_UTIL_H_ */
