|
From: | Ivan Medoedov |
Subject: | Re: [Tinycc-devel] { .field = value } struct initialization alternative |
Date: | Sun, 21 Jul 2019 19:56:59 +0200 |
Indeed. Sorry, my bad.Looks like the error is caused by __VA_ARGS__I'm using the following macro:#define ALLOC_INIT(type, ...) (type *)memdup((type[]){ __VA_ARGS__ }, sizeof(type))Foo* foo = ALLOC_INIT(Foo, { field: 123, field2: 456 });error: field expectedThis macro works fine with GCC and Clang.On Sun, Jul 21, 2019 at 6:50 PM Michael Matz <address@hidden> wrote:Hi,
On Sun, 21 Jul 2019, Ivan Medoedov wrote:
> Hello,
> { .field = value } syntax is not supported by TCC.
Why do you think so?
% cat designated-init.c
struct S {
int a, b;
};
struct S s = {.a = 2, .b = 3};
% ./tcc -c designated-init.c && echo ok
ok
%
Ciao,
Michael.
_______________________________________________
Tinycc-devel mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/tinycc-devel
[Prev in Thread] | Current Thread | [Next in Thread] |