Hacker News new | past | comments | ask | show | jobs | submit login

Huh - I remember using `char env` as the third parameter to main. After a quick Googling, it would seem that's a GCC-specific thing. Surprised there's a Linux-specific (or ELF-specific, as another commented) convention other than that one.



It isn't specific to GCC at all. It's widespread among unixes historically (and they generally have their own C compiler which is not GCC), and it was mentioned in the C89 standard.

However, it is not part of standard C or POSIX/SUS.

https://stackoverflow.com/a/10321474


HN's comment monster ate your asterisks. :-(

It should be:

  char **env


Ah ha - now there's an argument in favor of the `char *env[]` notation!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: