From 4ec1749b572a6422a60e547d2d2a3d25331dbbc7 Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 28 Apr 2023 15:57:38 +0000 Subject: [PATCH] Silence gcc-4 warnings about sk_sort() Tell it we deliberately ignore the return value, (we really don't care what the old comparison function was). --- lib/libcrypto/x509/x509_policy.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/libcrypto/x509/x509_policy.c b/lib/libcrypto/x509/x509_policy.c index 03f0f10ac52..e51e193085a 100644 --- a/lib/libcrypto/x509/x509_policy.c +++ b/lib/libcrypto/x509/x509_policy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_policy.c,v 1.23 2023/04/28 15:39:29 tb Exp $ */ +/* $OpenBSD: x509_policy.c,v 1.24 2023/04/28 15:57:38 tb Exp $ */ /* * Copyright (c) 2022, Google Inc. * @@ -380,7 +380,7 @@ process_certificate_policies(const X509 *x509, X509_POLICY_LEVEL *level, goto err; } - sk_POLICYINFO_set_cmp_func(policies, policyinfo_cmp); + (void)sk_POLICYINFO_set_cmp_func(policies, policyinfo_cmp); sk_POLICYINFO_sort(policies); cert_has_any_policy = 0; for (i = 0; i < sk_POLICYINFO_num(policies); i++) { @@ -544,7 +544,8 @@ process_policy_mappings(const X509 *cert, } /* Sort to group by issuerDomainPolicy. */ - sk_POLICY_MAPPING_set_cmp_func(mappings, compare_issuer_policy); + (void)sk_POLICY_MAPPING_set_cmp_func(mappings, + compare_issuer_policy); sk_POLICY_MAPPING_sort(mappings); if (mapping_allowed) { @@ -631,7 +632,7 @@ process_policy_mappings(const X509 *cert, } /* Sort to group by subjectDomainPolicy. */ - sk_POLICY_MAPPING_set_cmp_func(mappings, compare_subject_policy); + (void)sk_POLICY_MAPPING_set_cmp_func(mappings, compare_subject_policy); sk_POLICY_MAPPING_sort(mappings); /* Convert |mappings| to our "expected_policy_set" representation. */ @@ -995,7 +996,7 @@ X509_policy_check(const STACK_OF(X509) *certs, user_policies); if (user_policies_sorted == NULL) goto err; - sk_ASN1_OBJECT_set_cmp_func(user_policies_sorted, + (void)sk_ASN1_OBJECT_set_cmp_func(user_policies_sorted, asn1_object_cmp); sk_ASN1_OBJECT_sort(user_policies_sorted); } -- 2.20.1