plugin: workaround gcc bug that triggers a compilation error

GCC thinks str2type() returns NULL when it doesn't.

Closes #350
This commit is contained in:
Daniel Eklöf 2024-03-18 16:42:45 +01:00
parent c19a31d925
commit 4e07b63cef
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
2 changed files with 4 additions and 1 deletions

View file

@ -42,6 +42,7 @@
* mem: state updated on each bar redraw ([#352][352]). * mem: state updated on each bar redraw ([#352][352]).
* script: buffer overflow when reading large amounts of data. * script: buffer overflow when reading large amounts of data.
* i3/sway: module fails when reloading config file ([#361][361]). * 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 [311]: https://codeberg.org/dnkl/yambar/issues/311
[302]: https://codeberg.org/dnkl/yambar/issues/302 [302]: https://codeberg.org/dnkl/yambar/issues/302
@ -49,6 +50,7 @@
[343]: https://codeberg.org/dnkl/yambar/issues/343 [343]: https://codeberg.org/dnkl/yambar/issues/343
[352]: https://codeberg.org/dnkl/yambar/issues/352 [352]: https://codeberg.org/dnkl/yambar/issues/352
[361]: https://codeberg.org/dnkl/yambar/issues/361 [361]: https://codeberg.org/dnkl/yambar/issues/361
[350]: https://codeberg.org/dnkl/yambar/issues/350
### Security ### Security

View file

@ -126,7 +126,8 @@ type2str(enum plugin_type type)
case PLUGIN_DECORATION: return "decoration"; case PLUGIN_DECORATION: return "decoration";
} }
return NULL; assert(false && "invalid type");
return "";
} }
static void __attribute__((constructor)) static void __attribute__((constructor))