Bug 11539 – wrong "Orphan format specifier:" error message

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-18T06:05:00Z
Last change time
2014-09-21T22:59:53Z
Keywords
pull
Assigned to
nobody
Creator
monarchdodra

Comments

Comment #0 by monarchdodra — 2013-11-18T06:05:24Z
//---- import std.stdio; void main() { writefln("%s"); //1 writefln("%s hello %s"); //2 } //---- Produces: //1 std.format.FormatException@C:\D\dmd.2.064.2\dmd2\windows\bin\..\..\src\phobos\std\format.d(438): Orphan format specifier: %%s //2 std.format.FormatException@C:\D\dmd.2.064.2\dmd2\windows\bin\..\..\src\phobos\std\format.d(438): Orphan format specifier: %%s hello %s It appears the error message contains the actual format string, and not the actual format specifier. The fix is trivial, and in said exception line: text("Orphan format specifier: %", fmt)); s/fmt/spec.spec/ to fix
Comment #1 by hsteoh — 2014-09-19T22:27:00Z
Comment #2 by github-bugzilla — 2014-09-21T21:48:53Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/5d712d4375b72beb13d0abb10a270e09b38ecfdb Merge pull request #2538 from quickfur/issue11539 Fix wrong "Orphaned format specifier" error message.