lazy in main

Kirk McDonald kirklin.mcdonald at gmail.com
Tue Sep 5 12:28:15 PDT 2006


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



More information about the Digitalmars-d-bugs mailing list