Ticket #440 (Fixed)Tue Aug 22 20:05:43 UTC 2017
cc 5.72: nested designated initialisers are broken
Reported by: | Jeffrey Lee (213) | Severity: | Major |
Part: | RISC OS: C/C++ toolchain | Release: | |
Milestone: | Status | Fixed |
Details by Jeffrey Lee (213):
Initialising nested structs using designated initialisers appears to result in the values specified for the nested struct(s) being written to the wrong offset within the parent (it looks like they get written to the base of the parent)
The attached test case initialises the same struct with the same data, using three different methods. The first case (nested designated initialisers) produces the wrong output (6 7 0 0 5 0 0), while the other two cases (designated initialisers only used for the inner or outer layer) work fine (1 2 3 4 5 6 7).
Changelog:
Modified by Jeffrey Lee (213) Tue, August 22 2017 - 20:06:19 GMT
- Attachment added: bug
Modified by Colin (478) Wed, November 29 2017 - 18:02:04 GMT
Can I add that designated initialisers don’t work at all with __packed structs. The compilation fails with an ‘Internal inconsistency’ error.
Modified by Sprow (202) Wed, September 18 2024 - 21:43:52 GMT
- Status changed from Open to Fixed
Empirically, this is fixed in cc 5.93