|
From: | Jacob Bachmeyer |
Subject: | Re: [PATCH 1/1] config.guess: Use int |
Date: | Wed, 03 Apr 2024 19:57:03 -0500 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17 Mnenhy/0.7.6.0 |
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 beint 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
[Prev in Thread] | Current Thread | [Next in Thread] |