4005 – std.c.stdlib.exit in CTFE and more

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 4005 - std.c.stdlib.exit in CTFE and more
Summary: std.c.stdlib.exit in CTFE and more
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
Reported: 2010年03月25日 14:43 UTC by bearophile_hugs
Modified: 2015年06月09日 05:13 UTC (History)
2 users (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description bearophile_hugs 2010年03月25日 14:43:18 UTC
What's the right behaviour for this program? I think the CTFE has to stop, but dmd v2.042 doesn't stop to me:
import std.c.stdlib: exit;
int foo() {
 exit(1);
 return 100;
}
static assert(foo() == 100);
void main() {
 assert(foo() == 100);
 exit(1);
}
Comment 1 Don 2010年03月30日 11:57:58 UTC
The bug is quite different: CTFE calls to void functions without source code don't generate any error messages, so they are effectively ignored.
Comment 2 Walter Bright 2010年04月01日 13:53:48 UTC
changeset 429
Comment 3 Don 2010年04月09日 19:17:55 UTC
Fixed DMD1.058 and DMD2.043.


AltStyle によって変換されたページ (->オリジナル) /