https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178

--- Comment #18 from Paul Eggert <eggert at cs dot ucla.edu> ---
(In reply to uecker from comment #17)
> Fairly limited, but if you only have specific cases where you need
> this, this worked for me as a workaround:
> 
> #define TRUNC4(x) { x[0], x[1], x[2], x[3] }
> static char buf[4] = TRUNC4("aaaa");
Unfortunately that won't work for TZDB, first because the string length is
unknown, second because TZDB is portable and so cannot assume the GNU extension
of supporting "aaaa"[0] as a constant expression (the C standard does not
require this support).

Reply via email to