June 20, 2021 [Issue 22051] compiler allows compilation of malformed writefln statement, causing run-time crashes | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22051 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #1 from Basile-z <b2.temp@gmx.com> --- The specifier is only checked if you pass it has a template value parameter, like this: --- import std.stdio; void main (){ bool myvar = true; writefln!"Bool: % "(myvar); } --- otherwise a run-time error is the only way to get it checked. The string literal gives the impression that it is verifiable it could very well be something build from random sources. -- | ||||
June 20, 2021 [Issue 22051] compiler allows compilation of malformed writefln statement, causing run-time crashes | ||||
|---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22051 Basile-z <b2.temp@gmx.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |b2.temp@gmx.com --- Comment #2 from Basile-z <b2.temp@gmx.com> --- Maybe you expected https://dlang.org/spec/pragma.html#printf to work ? If so then that is also an invalid report because this works only on C variadic functions. writefln is a D variadic function. -- | ||||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply