Bug 24644 – write functions should handle invalid bool values specially

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-07-02T16:16:56Z
Last change time
2024-07-08T14:58:24Z
Keywords
pull
Assigned to
No Owner
Creator
Bolpat

Comments

Comment #0 by qs.il.paperinik — 2024-07-02T16:16:56Z
Functions of the family write(f)?(ln)? should handle invalid `bool` values (i.e. ones whose bit pattern isn’t `0x00` or `0x01`) by printing `__bool(0x??)` with `??` replaced by the hex value. For formatted write functions, that applies to the `%s` format. Numeric formats such as `%d`, `%x`, etc., already print the correct (bit-pattern) value. This would make debugging invalid bool values a lot easier.
Comment #1 by dlang-bot — 2024-07-02T16:28:49Z
@Bolpat created dlang/phobos pull request #9021 "Write functions should handle invalid bool values properly" fixing this issue: - Fix Bugzilla Issue 24644 - write functions should handle invalid bool values specially https://github.com/dlang/phobos/pull/9021
Comment #2 by dkorpel — 2024-07-08T14:58:24Z