On 7/21/2024 5:38 PM, Nathan Hartman wrote:
Hi Alan, I think we should have "int main(int argc, const char * argv[])" (added 'const' for argv). Maybe should grep for all instances of main in our code and docs and add const? I'm willing to do that. Let me know, Nathan
POSIX specifies the required prototype of main at https://pubs.opengroup.org/onlinepubs/007904975/functions/exec.html Yes, main() is specified in exec() and other locations refer to the exec() page for the specification of main().
POSIX does specify the prototype from the standpoint of the OS call into the application. Applications may, of course, use any form that they like but the OS must conform to this standard.