Thread overview | |||||
---|---|---|---|---|---|
|
September 05, 2006 lazy in main | ||||
---|---|---|---|---|
| ||||
This compiles successfully:
int main (lazy char [][] args)
{
return args.length;
}
But at runtime I get "Illegal instruction". Tested with gdc from SVN repos (uses dmd 0.166) on Mac OS X.
--
Carlos Santander Bernal
|
September 05, 2006 Re: lazy in main | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander | Carlos Santander wrote: > This compiles successfully: > > int main (lazy char [][] args) > { > return args.length; > } > > But at runtime I get "Illegal instruction". Tested with gdc from SVN repos (uses dmd 0.166) on Mac OS X. > I would call this a bug in the compiler. The spec states there are only four valid forms of main: void main() { ... } void main(char[][] args) { ... } int main() { ... } int main(char[][] args) { ... } http://digitalmars.com/d/function.html Since that isn't one of them, I would think the compiler should issue an error. -- Kirk McDonald Pyd: Wrapping Python with D http://pyd.dsource.org |
September 07, 2006 Re: lazy in main | ||||
---|---|---|---|---|
| ||||
Posted in reply to Kirk McDonald Attachments: | Kirk McDonald schrieb am 2006-09-05: > Carlos Santander wrote: >> This compiles successfully: >> >> int main (lazy char [][] args) >> { >> return args.length; >> } >> >> But at runtime I get "Illegal instruction". Tested with gdc from SVN repos (uses dmd 0.166) on Mac OS X. >> > > I would call this a bug in the compiler. The spec states there are only four valid forms of main: > > void main() { ... } > void main(char[][] args) { ... } > int main() { ... } > int main(char[][] args) { ... } > > http://digitalmars.com/d/function.html > > Since that isn't one of them, I would think the compiler should issue an error. Added to DStress as http://dstress.kuehne.cn/nocompile/m/main_07_A.d http://dstress.kuehne.cn/nocompile/m/main_07_B.d Thomas |
Copyright © 1999-2021 by the D Language Foundation