News for hackers. Stuff that matters.
Re:Where do argc and argv come from? by saagarjha on Monday August 10, 2020 @03:12PM (#24112892)
A fun fact related to the other points: you can legally call main in C, but not in C++ (it will usually work, though). Another fun fact is that on some platforms (Linux, macOS) you can "dynamically load" a (dynamically linked) program by calling dlopen on it and using dlsym to grab the address of main and just calling it :)
Re:Where do argc and argv come from? by kps on Monday August 10, 2020 @03:20PM (#24112975)
> you can legally call main in C

Good point. That makes it relatively difficult (not impossible) to compile `main` differently from other functions, other than diagnosing bad signatures if that's what the hosted environment requires, since it has to be callable like other functions.