Sunday, March 08, 2026

Re: function prototype

On Sun, Mar 8, 2026 at 3:14 PM Gustavo Rios <rios.gustavo@gmail.com> wrote:
>
> Hi folks!,
>
> what is the option of choice for openbsd developer :
>
> int main()
> int main(int argc, char **argv)
> int main(int argc, char **argv, char **envp)
>
> Which one ?

main is typically never prototyped, just defined.

that said, use the source luke:

mischief@beast.home.arpa:~/src/openbsd $ git grep -Er '^(int
|^)main\(' | cut -d: -f3 | sort | uniq -c | sort -n -k1 -r | sed 10q
742 main(int argc, char *argv[])
525 int main() {
350 main(int argc, char **argv)
159 main()
151 main(void)
145 int main(int argc, char **argv) {
123 int main()
51 int main(int argc, char *argv[]) {
39 int main(int argc, char** argv) {
26 int main(void)

the top result is usually what i also use.

>
> thanks!
>
> --
> In software systems the price of reliability is the pursuit of the utmost simplicity. It is a price which the very rich find most hard to pay.

No comments:

Post a Comment