http://bugzilla.gdcproject.org/show_bug.cgi?id=91
Iain Buclaw changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|---
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
Jens Bauer changed:
What|Removed |Added
CC||jens-bugzi...@gpio.dk
--- Comment #11 from J
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
--- Comment #10 from Peter Remmers ---
The more I read about this topic, the more I notice that D seems to have a long
history of this popping up, dating back to as early as 2005.
For example: http://comments.gmane.org/gmane.comp.lang.d.general/9
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
Marc Schütz changed:
What|Removed |Added
Status|RESOLVED|NEW
CC|
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
Ketmar Dark changed:
What|Removed |Added
CC||ket...@ketmar.no-ip.org
--- Comment #8 from
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
--- Comment #7 from Peter Remmers ---
I might add, always adding a zero termination costs nothing apart from a few
bytes in the data segment.
At the very least this is a performance issue, as GDC's toStringz(string) would
always copy, and DMD's a
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
Peter Remmers changed:
What|Removed |Added
CC||p.remm...@arcor.de
--- Comment #6 from Pe
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
Johannes Pfau changed:
What|Removed |Added
Status|NEW |RESOLVED
Resolution|
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
--- Comment #4 from Iain Buclaw 2014-01-12 17:03:57
GMT ---
(In reply to comment #3)
> Yes, but string _literals_ must be zero-terminated IIRC. I can't find the
> relevant docs on dlang.org but see for example this site:
> http://dlang.org/interf
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
--- Comment #3 from Johannes Pfau 2014-01-12 16:51:00
GMT ---
Yes, but string _literals_ must be zero-terminated IIRC. I can't find the
relevant docs on dlang.org but see for example this site:
http://dlang.org/interfaceToC.html "However, string
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
--- Comment #2 from Iain Buclaw 2014-01-12 16:00:11
GMT ---
http://dlang.org/arrays.html
"""
Since strings, however, are not 0 terminated in D, when transferring a pointer
to a string to C, add a terminating 0:
str ~= "\0";
or use the function
http://bugzilla.gdcproject.org/show_bug.cgi?id=91
--- Comment #1 from Iain Buclaw 2014-01-12 15:54:59
GMT ---
Hmm... dynamic D arrays aren't guaranteed to be zero-terminated. So I'm not
sure what the immediate problem is. :)
See StringExp::toElem for where to tweak the behaviour.
--
Configur
12 matches
Mail list logo