From 4e07b63cefdaa8b623ce7920e317ed8717d7c089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Mon, 18 Mar 2024 16:42:45 +0100 Subject: [PATCH] plugin: workaround gcc bug that triggers a compilation error GCC thinks str2type() returns NULL when it doesn't. Closes #350 --- CHANGELOG.md | 2 ++ plugin.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b66586..e31c0c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ * mem: state updated on each bar redraw ([#352][352]). * script: buffer overflow when reading large amounts of data. * i3/sway: module fails when reloading config file ([#361][361]). +* Worked around bug in gcc causing a compilation error ([#350][350]). [311]: https://codeberg.org/dnkl/yambar/issues/311 [302]: https://codeberg.org/dnkl/yambar/issues/302 @@ -49,6 +50,7 @@ [343]: https://codeberg.org/dnkl/yambar/issues/343 [352]: https://codeberg.org/dnkl/yambar/issues/352 [361]: https://codeberg.org/dnkl/yambar/issues/361 +[350]: https://codeberg.org/dnkl/yambar/issues/350 ### Security diff --git a/plugin.c b/plugin.c index ed7f63c..20dfbbf 100644 --- a/plugin.c +++ b/plugin.c @@ -126,7 +126,8 @@ type2str(enum plugin_type type) case PLUGIN_DECORATION: return "decoration"; } - return NULL; + assert(false && "invalid type"); + return ""; } static void __attribute__((constructor))