News for hackers. Stuff that matters.
Re:Checked C by WalterBright on Wednesday December 21, 2022 @03:15PM (#34085835)
Create an adapter:

    int main(int argc, char **argv) { return myMain(argv[0 .. argc]); }
Strings can be done like this:

    char [..] s = p[0 .. strlen(p)];
Re:Checked C by elcritch on Wednesday December 21, 2022 @03:49PM (#34086211)
Hmmm, the "[..]" is a fat pointer right? Couldn't you just say:

    int main(char [..] args)
Maybe with some way to tell the compiler the correct parameter order if needed? Perhaps:

    int main(char [..argc] argv)
I'm curious if ELF and other formats have enough info to figure that mapping out?
Re:Checked C by WalterBright on Wednesday December 21, 2022 @03:55PM (#34086261)
> the "[..]" is a fat pointer right?

yes

> if ELF and other formats have enough info to figure that mapping out?

No, as there is no semantic connection between `argc` and `argv`.