[Issue 4730] New: std.c.stdlib.exit in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 26 06:25:46 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4730

           Summary: std.c.stdlib.exit in CTFE
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-08-26 06:25:39 PDT ---
This enhancement request comes from bug 4005

Currently (dmd 2.048) the following program prints:
test.d(3): Error: exit cannot be interpreted at compile time, because it has no
available source code
test.d(6): Error: cannot evaluate foo() at compile time
test.d(6): Error: static assert  (foo() == 100) is not evaluatable at compile
time


import std.c.stdlib: exit;
int foo() {
    exit(1);
    return 100;
}
static assert(foo() == 100);
void main() {}


I'd like exit() to work at compile-time too, and stop the compilation
gracefully (dmd return value is the value given to exit()).

See also bug 3952

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list