[Bug 167] Setting Tsize_t, Tptrdiff_t in d-target.cc is not working

via D.gnu d.gnu at puremagic.com
Sun Nov 23 09:04:41 PST 2014


http://bugzilla.gdcproject.org/show_bug.cgi?id=167

--- Comment #3 from Johannes Pfau <johannespfau at gmail.com> ---
Yes, I hit this issue with 8bit AVRs (pointers/size_t is 16 bit on AVR although
registers are 8bit). Maybe a clean solution is to split Target::init /
Target::init2 and use Target::sizetsize in Type::init? However, overwriting
Type::tsize_t seems to work for now.

A related question: in d-codegen.cc::build_offset
tree ofs = fold_convert (Type::tsize_t->toCtype(), byte_offset);

shouldn't this use tptrdiff_t? I think this code could break if wordsize and
pointer size are different.
However, simply changing this to tptrdiff_t breaks the build. I guess we'd
really need a unsigned tptrdiff_t.

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/d.gnu/attachments/20141123/07c6d17d/attachment.html>


More information about the D.gnu mailing list