News for hackers. Stuff that matters.
Re:New C features in GCC 13 by kzrdude on Thursday May 04, 2023 @03:38PM (#35821002)
Maybe do not overthink it. 'x' is called a character literal, but it has the type int.

`{'x', 'y', 'z', '\0'}` does not have a type by itself at all, but it's valid syntax to use it to initialize various structs and arrays - some of those will have the size you are looking for, depending on which type of array or struct you choose to initialize with that.

These following two are incidentally valid whole expressions and have well defined types of char[4] and int[4] respectively. They have different sizes, as is expected from their types.

    (char[]){'x', 'y', 'z', '\0'}

    (int[]){'x', 'y', 'z', '\0'}
(This syntax is called compound literal and can be used with structs and arrays.)
Re:New C features in GCC 13 by nequo on Thursday May 04, 2023 @04:33PM (#35821686)
Thank you for the explanation and the Godbolt example! I appreciate it. Apologies for fumbling around in confusion.