Bug 11036 – Document that .stringof should not be used for code generation

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-13T14:57:00Z
Last change time
2013-09-16T08:25:30Z
Keywords
pull
Assigned to
andrej.mitrovich
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2013-09-13T14:57:03Z
As the .stringof representation often changes between compiler versions, it is not suitable for code generation because it is unreliable.
Comment #1 by andrej.mitrovich — 2013-09-13T15:09:02Z
Comment #2 by peter.alexander.au — 2013-09-14T13:45:09Z
(In reply to comment #0) > As the .stringof representation often changes between compiler versions, it is > not suitable for code generation because it is unreliable. Wouldn't a better solution be to define exactly what .stringof should return? Implementation-defined semantics should be avoided where possible since it breaks portability.
Comment #3 by andrej.mitrovich — 2013-09-14T13:51:20Z
(In reply to comment #2) > (In reply to comment #0) > > As the .stringof representation often changes between compiler versions, it is > > not suitable for code generation because it is unreliable. > > Wouldn't a better solution be to define exactly what .stringof should return? > Implementation-defined semantics should be avoided where possible since it > breaks portability. See Kenji's comment here: http://d.puremagic.com/issues/show_bug.cgi?id=10722#c6
Comment #4 by peter.alexander.au — 2013-09-14T14:43:06Z
(In reply to comment #3) > (In reply to comment #2) > > (In reply to comment #0) > > > As the .stringof representation often changes between compiler versions, it is > > > not suitable for code generation because it is unreliable. > > > > Wouldn't a better solution be to define exactly what .stringof should return? > > Implementation-defined semantics should be avoided where possible since it > > breaks portability. > > See Kenji's comment here: > http://d.puremagic.com/issues/show_bug.cgi?id=10722#c6 I can't see anything in Kenji's comment that suggests it couldn't be properly defined?
Comment #5 by andrej.mitrovich — 2013-09-16T08:25:30Z
Copied from 11035 which the pull erroneously referenced. (In reply to comment #1) > Commits pushed to master at https://github.com/D-Programming-Language/dlang.org > > https://github.com/D-Programming-Language/dlang.org/commit/30a0c704107274ce6d73a532283fae19d4c8f796 > Fixes Issue 11035 - Document lack of .stringof reliability. > > https://github.com/D-Programming-Language/dlang.org/commit/4cc00e0fe397334cc13e6f904b339ac8bf2a7cad > Merge pull request #380 from AndrejMitrovic/Fix11036 > > Issue 11035 - Document lack of .stringof reliability.