Closed shameempk closed 6 years ago
Bleh, try changing -std=c99
into -std=gnu99
in the Makefile
.
The anonymous-struct-in-union trick isn't quite C99 compliant but it's quite nice, the proper (?) solution would be to change the declaration above into
typedef union rgba_t {
struct {
uint8_t b;
uint8_t g;
uint8_t r;
uint8_t a;
} c;
uint32_t v;
} rgba_t;
And change every <obj>.{argb}
into <obj>.c.{argb}
but I'm not interested in doing so.
Feel free to re-open the ticket if you have further problems.
changing -std=c99 into -std=gnu99 in the Makefile
Yeah it solved the compilation error.
The anonymous-struct-in-union trick isn't quite C99 compliant but it's quite nice ...
This union (and accompanying code) seems to have other issues, besides the anonymous struct:
union
and then loading from another is implementation-defined behaviour in C99.... the proper (?) solution would be to change the declaration ...
A C99 compliant solution would be to use a plain uint32_t
, with shifting and masking to get/set the components.
OS: CentOS 6.9 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18)
make fails at:
I was able to bypass this error by changing:
to:
then it gets compiled but bar does not show up.