www.digitalmars.com         C & C++   DMDScript  

D.gnu - compiler does not complain no required return value

reply z gg.com writes:
digitalmars.D.bugs/4837

Instead, the generated binary will abort at run-time and give misleading
message:


int f() {
return 0;  // gdc Error: AssertError Failure rtn.d(3); dmd Aborted
}

int main(char[][] args) {
f();
return 0;
}
Aug 26 2005
next sibling parent z gg.com writes:
int f() {
  // return 0;  // gdc Error: AssertError Failure rtn.d(3); dmd Aborted

need to comment out line 3 to see the error.
}

int main(char[][] args) {
f();
return 0;
}

Aug 26 2005
prev sibling parent reply Stewart Gordon <smjg_1998 yahoo.com> writes:
z gg.com wrote:
 digitalmars.D.bugs/4837

Thank you for confessing your sin. http://smjg.port5.com/faqs/usenet/xpost.html Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 26 2005
parent reply z gg.com writes:
Thank you for confessing your sin.

http://smjg.port5.com/faqs/usenet/xpost.html

(Yes, it is intentionally done! Thank you for mis-interpreting it.) I'm cross-posting to make sure that gdc guys know this is a common bug. Ideally, we have 2 compilers now, so we should have 3 bug lists: D.gdc.bugs D.dmd.bugs D.gdc-dmd-common.bugs
Aug 26 2005
parent Stewart Gordon <smjg_1998 yahoo.com> writes:
z gg.com wrote:
 Thank you for confessing your sin.

 http://smjg.port5.com/faqs/usenet/xpost.html

(Yes, it is intentionally done! Thank you for mis-interpreting it.) I'm cross-posting to make sure that gdc guys know this is a common bug.

If you'd followed the link above, you'd know that you haven't crossposted. You've multiposted. Stewart. -- -----BEGIN GEEK CODE BLOCK----- Version: 3.1 GCS/M d- s:- a->--- UB P+ L E W++ N+++ o K- w++ O? M V? PS- PE- Y? PGP- t- 5? X? R b DI? D G e++>++++ h-- r-- !y ------END GEEK CODE BLOCK------ My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Aug 31 2005