Bug 21297 – profile builds in own project fail with 'statement is not reachable' in Phobos' std/concurrency.d
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-10-08T00:13:58Z
Last change time
2020-10-08T04:17:53Z
Assigned to
No Owner
Creator
JR
Comments
Comment #0 by zorael — 2020-10-08T00:13:58Z
dmd v2.093.1, Manjaro/Arch x86_64.
When trying to build a profile build of my project using dub and `dub -b profile`, it fails with a warning of 'statement not reachable' in `std/concurrency.d`.
---
import std;
void main()
{
bool receivedSomething;
static immutable instant = 1.seconds;
thisTid.send(1);
do
{
receivedSomething = receiveTimeout(instant, (Variant v) {});
}
while (receivedSomething);
}
---
dmd -inline -w -profile theabove.d
> /usr/include/dlang/dmd/std/concurrency.d(2087): Warning: statement is not reachable
https://run.dlang.io/is/u7se6m
Both -profile and -inline need to be present.
Comment #1 by pro.mathias.lang — 2020-10-08T04:17:53Z
*** This issue has been marked as a duplicate of issue 13165 ***