Bug 16351 – Nonstandard output library causes no-argument writeln() to fail.

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2016-08-03T23:29:00Z
Last change time
2016-10-01T11:46:24Z
Assigned to
nobody
Creator
andrew.benton675

Attachments

IDFilenameSummaryContent-TypeSize
1605alternate_write_patch.diffCorrectiontext/plain470

Comments

Comment #0 by andrew.benton675 — 2016-08-03T23:29:23Z
Created attachment 1605 Correction When using nonstandard output libraries such as https://github.com/sickill/stderred argumentless writeln() will fail on the enforce because it checks specifically for a new line to be returned. The error is resolved by following documentation for fputc and checking that output is not EOF, which indicates an error.
Comment #1 by github-bugzilla — 2016-08-04T13:39:20Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/65fe9934b48f5675957794ac41aaca8e14b6344e Fix issue 16351 When using nonstandard output libraries such as https://github.com/sickill/stderred argumentless writeln() will fail on the enforce because it check specifically for a newline to be returned. Checking instead that the output is not EOF follows the documentation and allows overridden write() functions from the standard library. https://github.com/dlang/phobos/commit/ee30556a348aede1d2523cb4d008f7eb0840a8a6 Merge pull request #4709 from andrewbenton/issue_16351 Fix issue 16351
Comment #2 by github-bugzilla — 2016-10-01T11:46:24Z