Josh Carroll wrote:
 > [...]
 > Note also that your main should have an int return type and should
 > return a value.

His main() function _did_ have an int return type (it
wasn't declared to be void), but of course it's better
style to write int explicitly.

By the way, FreeBSD's style(9) recommends to write the
function return type on a separate line and begin the
function name on column 1, like this:

int
main (int argc, char *argv[])
{
        ...
}

The clear advantage is that you can easily grep for the
definition of a particular function in a bunch of source
files:  grep '^main' *.c

Best regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606,  Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758,  Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart

FreeBSD-Dienstleistungen, -Produkte und mehr:  http://www.secnetix.de/bsd

Perl is worse than Python because people wanted it worse.
        -- Larry Wall
_______________________________________________
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscr...@freebsd.org"

Reply via email to