Re:Where do argc and argv come from?
by TallGuyShort on Monday August 10, 2020 @05:14PM
(#24114065)
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.
[ Parent
| on HN ]
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.
HN's comment monster ate your asterisks. :-(
It should be:
char **env
Re:Where do argc and argv come from?
by TallGuyShort on Tuesday August 11, 2020 @10:42AM
(#24120749)
Ah ha - now there's an argument in favor of the `char *env[]` notation!