Skip to content

Hello world doesn't compile on -O3 or higher #18

@dsimcha

Description

@dsimcha

Hello world program:

import std.stdio;

void main() {
    writeln("Hello, world.");
}

Everything works if I only use -O2 optimization, but:

$ ldc2 -O3 test.d
/usr/local/include/d/phobos/std/math.d(327): Error: pure function 'cos' cannot call impure function 'llvm_cos'
/usr/local/include/d/phobos/std/math.d(327): Error: safe function 'cos' cannot call system function 'llvm_cos'
/usr/local/include/d/phobos/std/math.d(327): Error: llvm_cos is not nothrow
/usr/local/include/d/phobos/std/math.d(325): Error: function std.math.cos 'cos' is nothrow yet may throw

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions