Thread overview
[Issue 17628] formattedWrite is impure on double
Jul 10, 2017
Vladimir Panteleev
Jul 10, 2017
Seb
Apr 19, 2018
Eduard Staniloiu
Oct 22, 2019
berni44
July 10, 2017
https://issues.dlang.org/show_bug.cgi?id=17628

--- Comment #1 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
Missing:
    import std.array : appender;

Seems to be impure because it calls snprintf (which I think may change FPU
flags or something).

--
July 10, 2017
https://issues.dlang.org/show_bug.cgi?id=17628

Seb <greensunny12@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |greensunny12@gmail.com

--- Comment #2 from Seb <greensunny12@gmail.com> ---
> which I think may change FPU flags or something

A hack would to create a pureSnprintf which resets errno to the value before its execution.

There are talks about doing this for free:

https://github.com/dlang/druntime/pull/1836

--
April 19, 2018
https://issues.dlang.org/show_bug.cgi?id=17628

Eduard Staniloiu <edi33416@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |edi33416@gmail.com

--- Comment #3 from Eduard Staniloiu <edi33416@gmail.com> ---
Since `pureMalloc`, `pureCalloc` and `pureFree` got accepted[0], maybe we could do the same for `sprintf` and `snprintf`?

[0] - https://github.com/dlang/druntime/pull/1836

--
October 22, 2019
https://issues.dlang.org/show_bug.cgi?id=17628

berni44 <bugzilla@d-ecke.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lt.infiltrator@gmail.com

--- Comment #4 from berni44 <bugzilla@d-ecke.de> ---
*** Issue 15321 has been marked as a duplicate of this issue. ***

--