Samuel Thibault, le dim. 24 sept. 2023 00:16:21 +0200, a ecrit:
> const mach_msg_type_long_t nameType = {
> .msgtl_header = {
> .msgt_name = 0,
> .msgt_size = 0,
> .msgt_number = 0,
> .msgt_inline = TRUE,
> .msgt_longform = TRUE,
> .msgt_deallocate = FALSE,
> .msgt_unused = 0
> },
> .msgtl_name = (unsigned short) MACH_MSG_TYPE_STRING_C,
> .msgtl_size = 1024,
> .msgtl_number =.1,
> };
>
>
> Is that actually defined behavior?
It doesn't seem well-defined indeed. The gcc documentation says that the
last initializer is used (which means mixture is not supported), and
-Woverride-init (which is in -Wextra) warns about it.
That should solve the problem.
Flavio
Samuel