From: Sergei Trofimovich <slyich@gmail.com>
To: ell@lists.linux.dev
Cc: Sergei Trofimovich <slyich@gmail.com>
Subject: [PATCH 2/4] cert: fix -std=c23 build failure
Date: Sun, 17 Nov 2024 00:18:12 +0000 [thread overview]
Message-ID: <20241117001814.2149181-2-slyich@gmail.com> (raw)
In-Reply-To: <20241117001814.2149181-1-slyich@gmail.com>
gcc-15 switched to -std=c23 by default:
https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff
259b06c212
As a result `ell` fails the build as:
ell/cert.c:390:32: error: incompatible types when returning type '_Bool' but 'const uint8_t *' {aka 'const unsigned char *'} was expected
390 | return false;
| ^~~~~
---
ell/cert.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ell/cert.c b/ell/cert.c
index 38bb01a..19a6556 100644
--- a/ell/cert.c
+++ b/ell/cert.c
@@ -387,13 +387,13 @@ const uint8_t *cert_get_extension(struct l_cert *cert,
seq = asn1_der_find_elem(ext, end - ext, 0, &tag, &len);
if (unlikely(!seq || tag != ASN1_ID_SEQUENCE))
- return false;
+ return NULL;
ext = seq + len;
oid = asn1_der_find_elem(seq, len, 0, &tag, &oid_len);
if (unlikely(!oid || tag != ASN1_ID_OID))
- return false;
+ return NULL;
if (!asn1_oid_eq(ext_id, oid_len, oid))
continue;
@@ -403,7 +403,7 @@ const uint8_t *cert_get_extension(struct l_cert *cert,
if (data && tag == ASN1_ID_BOOLEAN) {
if (data_len != 1)
- return false;
+ return NULL;
critical = *data != 0; /* Tolerate BER booleans */
@@ -411,7 +411,7 @@ const uint8_t *cert_get_extension(struct l_cert *cert,
}
if (unlikely(!data || tag != ASN1_ID_OCTET_STRING))
- return false;
+ return NULL;
if (out_critical)
*out_critical = critical;
--
2.47.0
next prev parent reply other threads:[~2024-11-17 0:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-17 0:18 [PATCH 1/4] settings: fix -std=c23 build failure Sergei Trofimovich
2024-11-17 0:18 ` Sergei Trofimovich [this message]
2024-11-17 0:18 ` [PATCH 3/4] dbus: " Sergei Trofimovich
2024-11-17 0:18 ` [PATCH 4/4] test-rtnl: " Sergei Trofimovich
2024-11-18 18:15 ` [PATCH 1/4] settings: " Denis Kenzior
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241117001814.2149181-2-slyich@gmail.com \
--to=slyich@gmail.com \
--cc=ell@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox