Closed dendibakh closed 1 year ago
Odd, the {} should zero-initialize that, and works on my machine. I wonder if it's a compiler version thing.
Ah, OK, I see what's going on now.
I compiled it with GCC 11.3.0, and it complained (because it's C-compilation, not C++) about {}
:
c-ray-f-mod.c:247:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
247 | pfm_perf_encode_arg_t perf_setup{};
| ^
c-ray-f-mod.c:249:5: error: ‘perf_setup’ undeclared (first use in this function)
249 | perf_setup.size = sizeof(pfm_perf_encode_arg_t);
| ^~~~~~~~~~
That's why I deleted it but didn't add memset
. :)
Ah. It's a c++-ism.
On Fri, Apr 14, 2023, 9:50 AM Denis Bakhvalov @.***> wrote:
Odd, the {} should zero-initialize that, and works on my machine. I wonder if it's a compiler version thing.
Ah, OK, I see what's going on now. I compiled it with GCC 11.3.0, and it complained about {}:
c-ray-f-mod.c:247:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘{’ token 247 | pfm_perf_encode_arg_t perf_setup{}; | ^ c-ray-f-mod.c:249:5: error: ‘perf_setup’ undeclared (first use in this function) 249 | perf_setup.size = sizeof(pfm_perf_encode_arg_t); | ^
~~~~~That's why I deleted it but didn't add memset. :)
— Reply to this email directly, view it on GitHub https://github.com/dendibakh/perf-book/pull/17#issuecomment-1508540091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAK4S7VUSSHWIA6NW4P5EDXBFI3XANCNFSM6AAAAAAUPFPOB4 . You are receiving this because you were mentioned.Message ID: @.***>
Merged with #20.
Odd, the {} should zero-initialize that, and works on my machine. I wonder if it's a compiler version thing.
On Fri, Apr 14, 2023, 6:56 AM Denis Bakhvalov @.***> wrote: