mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
gems: Avoid flexible array member in Cached_font.
Switch the code to 0 lengh array instead. The code in Lru_cache::element_size calls sizeof on this structure. This works in gcc, but fails when using clang. Even for GCC however the documentation states: "Flexible array members have incomplete type, and so the sizeof operator may not be applied. As a quirk of the original implementation of zero-length arrays, sizeof evaluates to zero." Basically its an implementation quirk that clang does not support. Both GCC and clang do support zero sized arrays however so using them here allows both compilers to process this code. Ref: https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html Issue #4421
This commit is contained in:
parent
c1a566ce63
commit
05e4993d2e
@ -30,7 +30,7 @@ class Genode::Cached_font : public Text_painter::Font
|
||||
|
||||
struct Cached_glyph : Glyph, Noncopyable
|
||||
{
|
||||
Glyph::Opacity _values[];
|
||||
Glyph::Opacity _values[0];
|
||||
|
||||
/*
|
||||
* The number of values is not statically known but runtime-
|
||||
|
Loading…
x
Reference in New Issue
Block a user