Skip to content

Comments

kmscon_conf.c: Fix llvm compilation failure#225

Merged
kdj0c merged 1 commit intokmscon:mainfrom
aduskett:llvm-fix
Jan 16, 2026
Merged

kmscon_conf.c: Fix llvm compilation failure#225
kdj0c merged 1 commit intokmscon:mainfrom
aduskett:llvm-fix

Conversation

@aduskett
Copy link

When building with an LLVM toolchain, the follow error occurs:

kmscon_conf.c:757:72:
error: expression which evaluates to zero treated as a null pointer constant
of type 'void *' [-Werror,-Wnon-literal-null-conversion]
CONF_OPTION(0, 0, "gpus", &conf_gpus, NULL, NULL, NULL, &conf->gpus, KMSCON_GPU_ALL),
                                                                     ^~~~~~~~~~~~~~
1 error generated.

Fix the error by adding a cast to (void *).

When building with an LLVM toolchain, the follow error occurs:

```
kmscon_conf.c:757:72:
error: expression which evaluates to zero treated as a null pointer constant
of type 'void *' [-Werror,-Wnon-literal-null-conversion]
CONF_OPTION(0, 0, "gpus", &conf_gpus, NULL, NULL, NULL, &conf->gpus, KMSCON_GPU_ALL),
                                                                     ^~~~~~~~~~~~~~
1 error generated.
```

Fix the error by adding a cast to (void *).
@kdj0c
Copy link
Contributor

kdj0c commented Jan 16, 2026

Thanks for your patch.
It's not pretty, but the CONF_OPTION_xx macro casts default value to void*, so let's do that here too.

@kdj0c kdj0c merged commit a1fc510 into kmscon:main Jan 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants