diff mbox series

[1/4] settings: fix -std=c23 build failure

Message ID 20241117001814.2149181-1-slyich@gmail.com (mailing list archive)
State Accepted, archived
Headers show
Series [1/4] settings: fix -std=c23 build failure | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
prestwoj/iwd-ci-setupell success Prep - Setup ELL
prestwoj/iwd-ci-makedistcheck success Make Distcheck
prestwoj/iwd-ci-build success Build - Configure
prestwoj/iwd-ci-makecheck success Make Check
prestwoj/iwd-ci-makecheckvalgrind success Make Check w/Valgrind
prestwoj/iwd-ci-clang success clang PASS
prestwoj/iwd-ci-testrunner success test-runner PASS

Commit Message

Sergei Trofimovich Nov. 17, 2024, 12:18 a.m. UTC
gcc-15 switched to -std=c23 by default:

    https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212

As a result `ell` fails the build as:

    ell/settings.c: In function 'l_settings_get_embedded_value':
    ell/settings.c:1521:24: error: incompatible types when returning type '_Bool' but 'const char *' was expected
     1521 |                 return false;
          |                        ^~~~~

The change uses poiter instead of a bool to return the zero value.
---
 ell/settings.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Denis Kenzior Nov. 18, 2024, 6:15 p.m. UTC | #1
Hi Sergei,

On 11/16/24 6:18 PM, Sergei Trofimovich wrote:
> gcc-15 switched to -std=c23 by default:
> 
>      https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=55e3bd376b2214e200fa76d12b67ff259b06c212
> 
> As a result `ell` fails the build as:
> 
>      ell/settings.c: In function 'l_settings_get_embedded_value':
>      ell/settings.c:1521:24: error: incompatible types when returning type '_Bool' but 'const char *' was expected
>       1521 |                 return false;
>            |                        ^~~~~
> 
> The change uses poiter instead of a bool to return the zero value.
> ---
>   ell/settings.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 

All applied, thanks.

Regards,
-Denis
diff mbox series

Patch

diff --git a/ell/settings.c b/ell/settings.c
index a5f17d1..b46d00b 100644
--- a/ell/settings.c
+++ b/ell/settings.c
@@ -1518,7 +1518,7 @@  LIB_EXPORT const char *l_settings_get_embedded_value(
 	struct embedded_group_data *group;
 
 	if (unlikely(!settings))
-		return false;
+		return NULL;
 
 	group = l_queue_find(settings->embedded_groups,
 					embedded_group_match, group_name);