Petr Vorel wrote:
[...]
please *don't* put the return type on the same line as the function name,
and change the argument list to `(void)` while you're touching this.
We want the end result to be
int
main (void)
Sure, I'll do it in v2. May I know the reason for this?
The GNU Coding Standards (in section 5.1 "Formatting Your Source Code")
call for this layout, and later mention that this is the only actual
requirement; the other details are mere recommendations.
Does this rule (return type on a separate line) applies to main
with args (Ben is the author)?
It ordinarily *should* apply, but there may be exceptions for very short
programs.
In any case, putting the return type on a separate line is a consequence
of the actual rule, which is the function names must begin in the first
column, and the next unindented line must contain the opening brace of
the function body. The GNU Coding Standards explain that there are
tools that use this pattern to identify functions, therefore all GNU
code must adhere to it.
I am not really sure that this rule makes sense for Autoconf test
programs, especially those that define *only* main() and no other functions.
-- Jacob