3 ms·
Another one, adhoc struct declaration in the return type of a function: struct bla_t { int a, b, c, d; } make_bla(void) { return (struct bla_t){ .a
by flohofwoe 4y ago
Another one, adhoc struct declaration in the return type of a function:
struct bla_t { int a, b, c, d; } make_bla(void) {
return (struct bla_t){ .a=1, .b=2, .c=3, .d=4 };
}
https://www.godbolt.org/z/Pha7dPzeq https://www.godbolt.org/z/Pha7dPzeq
Also to be pedantic: "= {};" is not valid C (at least until C23) and fails to compile on MSVC - GCC and Clang accept it as a non-standard language extension though (the proper form would be "= {0};").