I think it's best to add the required functionality to the reorderIlist function in SDCCval.c or to rewrite it accordingly.
It basically has to keep track of the type of the ilist elements it iterates over and move parts of the ilist to nested ilists if the type indicates an aggregate type but the ilist is not deep.
This has to take the special case from [bugs:#3121] into account, too. It is about a struct variable in an initializer list.
A more complex case is
struct ss {
int buf[4];
int len;
};
struct ss q[][3] = {{1, 2}, {3, 4, 5, 6}, 7, 9, 0, 1};
GCC can accept it, but I can not figure how to handle it in SDCC.
Ticket moved from /p/sdcc/bugs/2387/
Can't be converted:
I think it's best to add the required functionality to the
reorderIlistfunction inSDCCval.cor to rewrite it accordingly.It basically has to keep track of the type of the
ilistelements it iterates over and move parts of theilistto nestedilists if the type indicates an aggregate type but theilistis not deep.This has to take the special case from [bugs:#3121] into account, too. It is about a struct variable in an initializer list.
Related
Bugs: #3121
Last edit: Benedikt Freisen 2021-02-07