Bug 656 – lazy in main

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
PowerPC
OS
Mac OS X
Creation time
2006-12-06T16:31:00Z
Last change time
2015-06-09T05:15:22Z
Assigned to
dvdfrdmn
Creator
casantander1

Comments

Comment #0 by casantander1 — 2006-12-06T16:31:50Z
Using GDC rev-50. //--------- int main (lazy char [][] args) { return args.length; } //--------- $ gdmd test $ ./test Illegal instruction $ ./test foo Illegal instruction //--------- How valid is this code?
Comment #1 by kirklin.mcdonald — 2006-12-06T16:45:36Z
[email protected] wrote: > http://d.puremagic.com/issues/show_bug.cgi?id=656 > > Summary: lazy in main > Product: GDC > Version: unspecified > Platform: Macintosh > OS/Version: Mac OS X > Status: NEW > Severity: normal > Priority: P2 > Component: glue layer > AssignedTo: [email protected] > ReportedBy: [email protected] > > > Using GDC rev-50. > > //--------- > int main (lazy char [][] args) > { > return args.length; > } > //--------- > $ gdmd test > $ ./test > Illegal instruction > $ ./test foo > Illegal instruction > //--------- > > How valid is this code? > > It shouldn't be valid. At the very bottom of http://digitalmars.com/d/function.html it says: main() must be declared using one of the following forms: void main() { ... } void main(char[][] args) { ... } int main() { ... } int main(char[][] args) { ... } int main(lazy char[][] args) isn't any of these. I'm not even sure what it's supposed to mean.
Comment #2 by casantander1 — 2006-12-06T16:53:12Z
(In reply to comment #1) > [email protected] wrote: > > http://d.puremagic.com/issues/show_bug.cgi?id=656 > > > > //--------- > > int main (lazy char [][] args) > > { > > return args.length; > > } > > //--------- > > $ gdmd test > > $ ./test > > Illegal instruction > > $ ./test foo > > Illegal instruction > > //--------- > > > > How valid is this code? > > > > > > It shouldn't be valid. At the very bottom of > http://digitalmars.com/d/function.html it says: > > main() must be declared using one of the following forms: > > void main() { ... } > void main(char[][] args) { ... } > int main() { ... } > int main(char[][] args) { ... } > > int main(lazy char[][] args) isn't any of these. I'm not even sure what > it's supposed to mean. > Neither do I, but if it's not supposed to be valid, the compiler shouldn't compile it.
Comment #3 by thomas-dloop — 2006-12-07T05:00:34Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 [email protected] schrieb am 2006-12-06: > http://d.puremagic.com/issues/show_bug.cgi?id=656 > Using GDC rev-50. > > //--------- > int main (lazy char [][] args) > { > return args.length; > } > //--------- > $ gdmd test > $ ./test > Illegal instruction > $ ./test foo > Illegal instruction > //--------- Test cases: http://dstress.kuehne.cn/nocompile/m/main_07_A.d http://dstress.kuehne.cn/nocompile/m/main_07_B.d Thomas -----BEGIN PGP SIGNATURE----- iD8DBQFFd/grLK5blCcjpWoRApB+AKCuGR53dT3Z3nkewSWlDor7/CbldQCgrXIR AMltN0Pxbd0QYw3PEMCcqwQ= =KlJL -----END PGP SIGNATURE-----
Comment #4 by bugzilla — 2006-12-12T04:17:53Z
Fixed DMD 0.176
Comment #5 by yebblies — 2012-01-31T20:13:12Z
*** Issue 895 has been marked as a duplicate of this issue. ***