Bug 21000 – -preview=nosharedaccess precludes use of stdin,stdout,stderr

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Other
Creation time
2020-07-01T12:07:07Z
Last change time
2022-10-05T02:17:09Z
Keywords
pull
Assigned to
No Owner
Creator
Bruce Carneal

Comments

Comment #0 by bcarneal11 — 2020-07-01T12:07:07Z
import std.stdio; void main() { writeln("Hello world!"); Compilation of the above with -preview=nosharedaccess fails. The three error messages, one each for stdin, stdout and stderr, look like this: /dlang/dmd/linux/bin64/../../src/phobos/std/stdio.d-mixin-4841(4841): Error: direct access to shared stdin is not allowed, see core.atomic In the current stdio.d, the offending mixin is at line 4858 within the property template named "makeGlobal". The fix may be as simple as a cast at that location.
Comment #1 by bcarneal11 — 2020-07-01T12:16:25Z
main() needs a closing brace.
Comment #2 by dlang-bot — 2022-09-09T19:12:28Z
@atilaneves created dlang/phobos pull request #8562 "Fix issue 21000 - allow use of std{in,out,err} with -preview=noshared…" fixing this issue: - Fix issue 21000 - allow use of std{in,out,err} with -preview=nosharedaccess https://github.com/dlang/phobos/pull/8562
Comment #3 by dlang-bot — 2022-10-05T02:17:09Z
dlang/phobos pull request #8562 "Fix issue 21000 - allow use of std{in,out,err} with -preview=noshared…" was merged into master: - 03ac553e03d2c018c7e4b050c4cb4e893bdf79dc by Atila Neves: Fix issue 21000 - allow use of std{in,out,err} with -preview=nosharedaccess https://github.com/dlang/phobos/pull/8562