D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21297 - profile builds in own project fail with 'statement is not reachable' in Phobos' std/concurrency.d
Summary: profile builds in own project fail with 'statement is not reachable' in Phobo...
Status: RESOLVED DUPLICATE of issue 13165
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 enhancement
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-08 00:13 UTC by JR
Modified: 2020-10-08 04:17 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description JR 2020-10-08 00:13:58 UTC
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 Mathias LANG 2020-10-08 04:17:53 UTC

*** This issue has been marked as a duplicate of issue 13165 ***