Richard Guenther wrote:
On Thu, Nov 26, 2009 at 12:04 AM, Tom Tromey <tro...@redhat.com> wrote:
"Basile" == Basile STARYNKEVITCH <bas...@starynkevitch.net> writes:
Basile> Of course, not every one has it (notably those working on non-linux
Basile> systems), but for those who have it, requiring that every C file
Basile> inside GCC has been automatically indented with GNU indent could
Basile> help.
I looked at this once. GNU indent doesn't have all the features needed
to make it correctly support the GCC coding style. I filed a bunch of
GNU indent bug reports, but AFAIK none of them has ever been fixed.
You could still do this if you didn't mind a coding style change at the
same time. And of course, this will only help the .c and .h files, not
everything else.
Not to mention that I'd find this a quite pointless excercise. I trust
humans much more than the little brain of GNU indent (or whatever
you can code into a reasonable replacement).
I don't understand that point. Do you believe that removing trailing whitespace cannot be automatized? Could you explain
why?
Of course, we might have very clever rules for whitespaces (I don't claim to understand all of GCC coding styles). My
opinion is that, if the rules about spaces are too clever to be easily handled by a small piece of software, we should
better change these rules to simplify them.
Again, I am only speaking of whitespaces! Are they so important inside C code that we could not in principle agree that
tools put them better than humans?
If our rules for whitespaces are so complex (and perhaps they are), shouldn't we aim to simplify them? We could decide
that GNU indent -the current version- is doing a good enough job for us.
If feel that all this flamewar is non-sensical, since we only speak of spaces!!!
And I have no understanding about the design process of our whitespace rules?
Who decided them and when?
Why would the GCC code written in C become less readable if we decided to GNU indent it? There might be some corner
cases which could be handled by clever /* *INDENT-OFF* */ comments.
If we decided to use a software tool to indent our code, all the reviewers would have less (unininteresting) work, I
mean correcting the whitespaces. Since human reviewers are the bottleneck in the development of GCC, shouldn't a tiny
improvement to help them be considered? I am sure that Diego Novillo alone spent more than an hour of his valuable time
to improve my spaces in my code.
Wouldn't be a simple rule like always run indent on GCC source files written in
C be much more efficient for everyone?
Why should in 2010 whitespaces (especially trailing ones) be corrected by
humans?
I don't really want to patch GNU indent (unless it would be easy, which it is probably not). I just want to push the
idea that have more tools to help code being reviewed is valuable. Of course, I cannot decide that alone. I am just
throwing a proposal for discussion.
Wouldn't it be better to change a bit our coding rules, to make tools like indent better working for them & us, and to
have reviewers put their effort on something more interesting than spaces!!!
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***