Changes between Initial Version and Version 1 of Ticket #293
- Timestamp:
- Dec 5, 2024, 10:09:20 AM (13 days ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #293 – Description
initial v1 1 1 A string literal (possibly enclosed in `{}`)[1] used to initialize an array is treated as a list initializer with the characters in the string (and sometimes the null terminator) as elements in the list. This needs some special handling to be fully handled, and currently there are no special cases to handle that. 2 2 3 This is currently working anyways because (I believe) both array types are decomposed into pointer types and it tries to assign the resulting pointers directly. This gets it to C which does do the special handling. It does become a problem if the type of the string changes[2].3 This is a refactoring to unblock another ticket[2]. It appears to work currently works out without any special handling by decomposing both arrays to pointers. Making string literals mean it would try to initialize a pointer to mutable character from a pointer to constant characters, this is not allowed, but copying data to a mutable array from a constant arrray is. 4 4 5 5 [1] https://en.cppreference.com/w/c/language/array_initialization