This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Coding standards (was treelang patch)
- From: Tim Josling <tej at melbpc dot org dot au>
- To: Geoff Keating <geoffk at geoffk dot org>
- Cc: gcc-patches at gcc dot gnu dot org, gcc at gcc dot gnu dot org
- Date: Mon, 13 May 2002 06:36:36 +1000
- Subject: Re: Coding standards (was treelang patch)
- Organization: Melbourne PC User Group
- References: <3CD4ACEA.863FCA58@melbpc.org.au> <jmn0vff23a.fsf@desire.geoffk.org>
Geoff Keating wrote:
> * It seems to have many lines that are > 80 characters, and your
> posting program word-wrapped it---this is two problems in one, since
> generally source lines should be less than 80 characters, as well as
> the word-wrapping.
Point taken about the wrapping. I have changed the option in my email client.
I have been surruptitiously working on a program, called pedant, which checks for compliance with the coding standard.
I was under the impression that 80 character lines were the limit, so I coded the test into pedant. But when I went looking for scriptural authority in the FSF or GCC coding standards, I couldn't find
anything that says there is a line size limit.
There should be such a limit IMHO. Perhaps it should be added to the GCC coding conventions document.
By the way there are over 1600 instances of long lines in gcc/*.[chly] at the moment. Only a few are in generated code.
I was also under the impression that one should not use tabs in GCC programs. Again I could find no authority for this point (over a hundred thousand instances of this, so maybe I made that one up).
I also note that the spacing requirement is only a recommendation.
e.g.
x = y + z;
rather than
x=y+z;
The comments I received about spacing suggested that it was more than that!
Tim Josling