]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
Cast uses of return_*(), nop() and enumerator_create_empty()
authorTobias Brunner <tobias@strongswan.org>
Fri, 21 Feb 2025 16:00:44 +0000 (17:00 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 19 Mar 2025 09:22:37 +0000 (10:22 +0100)
As described in the previous commit, GCC 15 uses C23 by default and that
changes the meaning of such argument-less function declarations.  So
whenever we assign such a function to a pointer that expects a function
with arguments it causes an incompatible pointer type warning.  We
could define dedicated functions/callbacks whenever necessary, but this
seems like the simpler approach for now (especially since most uses of
these functions have already been cast).

src/charon-nm/nm/nm_handler.c
src/libcharon/encoding/payloads/encrypted_payload.c
src/libcharon/plugins/android_dns/android_dns_handler.c
src/libcharon/plugins/ha/ha_attribute.c
src/libcharon/plugins/updown/updown_handler.c
src/libstrongswan/utils/identification.c

index d7331ad72f6d5dd6509976535c0a7cb644cc6df6..39d0190ac9e8f09950497702f51491eb840b20b0 100644 (file)
@@ -195,7 +195,7 @@ nm_handler_t *nm_handler_create()
                .public = {
                        .handler = {
                                .handle = _handle,
-                               .release = nop,
+                               .release = (void*)nop,
                                .create_attribute_enumerator = _create_attribute_enumerator,
                        },
                        .create_enumerator = _create_enumerator,
index 676d00b7a29a5a0cfec3cfe9346951d7970c1652..4821c6108ed94b1a1fa8b47c3b886d01c216ebfa 100644 (file)
@@ -1023,7 +1023,7 @@ encrypted_fragment_payload_t *encrypted_fragment_payload_create()
                                .get_length = _frag_get_length,
                                .add_payload = _frag_add_payload,
                                .remove_payload = (void*)return_null,
-                               .generate_payloads = nop,
+                               .generate_payloads = (void*)nop,
                                .set_transform = _frag_set_transform,
                                .get_transform = _frag_get_transform,
                                .encrypt = _frag_encrypt,
index 78f4f702aec4a2df4adf52bccc13ff4166c32de4..14d2ff99aa3439b452f171142e1a00c708bd9121 100644 (file)
@@ -191,7 +191,7 @@ METHOD(enumerator_t, enumerate_dns, bool,
        VA_ARGS_VGET(args, type, data);
        *type = INTERNAL_IP4_DNS;
        *data = chunk_empty;
-       this->venumerate = return_false;
+       this->venumerate = (void*)return_false;
        return TRUE;
 }
 
index b865a4b829be58cf9a5748e2bb03e33ab9a54a57..103d1a9378460e77af600e224ea0b15087b5b0a4 100644 (file)
@@ -381,7 +381,7 @@ ha_attribute_t *ha_attribute_create(ha_kernel_t *kernel, ha_segments_t *segments
                        .provider = {
                                .acquire_address = _acquire_address,
                                .release_address = _release_address,
-                               .create_attribute_enumerator = enumerator_create_empty,
+                               .create_attribute_enumerator = (void*)enumerator_create_empty,
                        },
                        .reserve = _reserve,
                        .destroy = _destroy,
index 36eb15615a48b01032d60776df67b8ddb16e8727..3707e1e658c2e779802928c0e691251e63024a10 100644 (file)
@@ -220,7 +220,7 @@ updown_handler_t *updown_handler_create()
                        .handler = {
                                .handle = _handle,
                                .release = _release,
-                               .create_attribute_enumerator = enumerator_create_empty,
+                               .create_attribute_enumerator = (void*)enumerator_create_empty,
                        },
                        .create_dns_enumerator = _create_dns_enumerator,
                        .destroy = _destroy,
index d31955b38061b532c21b657952aa863314b7d859..58a05052dc1307ed6a844f10d271cb7e96f7a01b 100644 (file)
@@ -1625,7 +1625,7 @@ static private_identification_t *identification_create(id_type_t type)
                        this->public.hash = _hash_binary;
                        this->public.equals = _equals_binary;
                        this->public.matches = _matches_any;
-                       this->public.contains_wildcards = return_true;
+                       this->public.contains_wildcards = (void*)return_true;
                        break;
                case ID_FQDN:
                case ID_RFC822_ADDR:
@@ -1660,13 +1660,13 @@ static private_identification_t *identification_create(id_type_t type)
                        this->public.hash = _hash_binary;
                        this->public.equals = _equals_binary;
                        this->public.matches = _matches_range;
-                       this->public.contains_wildcards = return_false;
+                       this->public.contains_wildcards = (void*)return_false;
                        break;
                default:
                        this->public.hash = _hash_binary;
                        this->public.equals = _equals_binary;
                        this->public.matches = _matches_binary;
-                       this->public.contains_wildcards = return_false;
+                       this->public.contains_wildcards = (void*)return_false;
                        break;
        }
        return this;