From: SourceForge.net <no...@so...> - 2010-01-29 16:22:19
|
Bugs item #2942247, was opened at 2010-01-29 14:47 Message generated for change (Comment added) made by spth You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2942247&group_id=599 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Philipp Krause (spth) Assigned to: Nobody/Anonymous (nobody) Summary: Arrays of _Bool are very broken Initial Comment: Unfortunately my implementation of _Bool recently added to sdcc is broken. Fortunately it seems there is only one broken aspect, but that one is really broken: Arrays of _Bool. Three problems: 1) Global arrays of _Bool are not correctly initialized, i.e. the initializers are not cast to _Bool: const _Bool foo[2] = {1, 2}; will store 2 in foo[2] isntead of one (same problem for non-const array. 2) Accesses to the array access the array's address instead, i.e. reading foo[1] generates code to read the upper byte of foo's address. 3) Lokal definitions of arrays of _Bool with initializers crash the compiler. Philipp The attached file shows the problems, I tired compiling with sdcc --std-c99 -mz80 These bugs are not located in a backend. ---------------------------------------------------------------------- >Comment By: Philipp Krause (spth) Date: 2010-01-29 17:22 Message: This shall be a bug report about just problems 2) and 3). Upon closer investigation problem 1) is different: It does not affect const arrays of bool and it does affect arrays of type other than bool. I'll file a separate bug report about that one. Philipp ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=100599&aid=2942247&group_id=599 |